bluechi
bluechi copied to clipboard
Remove node name duplication in the `ListUnits` and `ListUnitFiles` API
Please describe what you would like to see
For the API method ListUnits
- on the Controller interface
- and on the Node interface
the returned structure is a list of all unit (files) and the name of the respective node a(sssssssouso)
, for example:
[
("node-1", ...),
("node-1", ...),
("node-2", ...),
("node-2", ...),
...
]
The node name is duplicated quite a lot in this structure. It would be more efficient to use a dict and store it only once, e.g.:
{
"node-1": [
(...), (...), ...
],
"node-2": [
(...), (...), ...
],
...
This could be achieved by changing the D-Bus API to a{sa(ssssssouso)}
- where the dict has the node name as key (basic D-Bus type string) and the unit information as value (container D-Bus type). This way the node name isn't repeated n times for n units.
Notes:
* The same applies for ListUnitFiles
(added in https://github.com/eclipse-bluechi/bluechi/issues/889)
** This is a breaking API change