Open Apollon77 opened 4 years ago
I wanted to monitor such info for a long time... TCP and UDP ports must be distinguished, not just "network"
TCP and UDP ports must be distinguished, not just "network"
I would then propose still "network" but a key in the object like "portType: 'tcp'/'udp'" or such
Would it make sense if this proposal would also double as a permission list? Then we could combine it with https://github.com/ioBroker/ioBroker.js-controller/issues/348 for example.
ioBroker could show the user which resources the adapter wants to access, so the user can decide whether he wants it or not. Or we could even store which permission a users wants to give by default, so he only needs to be asked again when a new adapter wants more.
Hm ... in fact it is the "you configured it and so you want to use it " ... So I would see it as a implicit agreementlist already ... I do not see a point in allowing to decline the usage ?!
Maybe I was unclear:
Puuhhh ... I think this is a complete different story, or?! And all Devs need to be very transparent for their adapters on what they use. It feels to me as an own issue
We discussed several times that it would be good to know which "ressources" are used by adapter instances. With resources I mean:
Beside the "user info cases" described above also the planned "HA adapter" would utilize these informations to decide if an instance can be moved or not.
We already have the "getPort" method which searches a free port. I would not adjust this method but leave it as is because "finding" a port and "using" is are two different topics.
My idea would be the following: We add a new "resources" key to the io-package common section where an adapter developer can describe the resources used by his adapter in general, e.g.:
So all static stuff can be "hard" configured in io-package, for the details of it we have extra methods in adapter:
The infos collected here are provided as a new state in system.adapter.name.instance as a json of the array. So all adapters can access the infos. The data statically defined in io-package can be inserted here directly on installation time of the adapter and will be adjusted "On the fly". The content will not be cleared on adapter stop.
The js-controller process will also describe to all these states of "his" adapters and will provide a summary state in system.host.name of used network/serial ports of active adapters and which adapter uses it, e.g.
This could be used by Admin UIs of adapters that allow resource definition to grey out stuff or such.
Also "getPort" method can be adjusted to check the list of defined port here to not use them.
What do you think about this idea?
Ingo