Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeviceGroup class should remove method .add_child_device(), which is confusing and also leads to incorrect behaviors #53

Open
dsun-edwards opened this issue Feb 27, 2024 · 1 comment

Comments

@dsun-edwards
Copy link

Method .add_child_device() should be removed from DeviceGroup, as DeviceGroup uses .add_child_asset() to associate a device with the group. Using DeviceGroup.add_child_device() for this purpose is very confusing and the results seems also incorrect as stated in below issue 1.

Issue 1.

  • when use DeviceGroup.add_child_device(), the added device is not shown in the group from the tenant. However, deleting the group and its assets will also delete the device. This is very confusing.

Issue 2.

  • After execute DeviceGroup.add_child_asset(), the attributes of the DeviceGroup .child_assets are still empty, which seems not right.
@chisou
Copy link
Collaborator

chisou commented Feb 27, 2024

I agree - this is very confusing. A device group is not a device as such, hence it can't have child "devices" and the method can't be used in sensible manner. However, devices as well as device groups are created through the Inventory API which does not prevent you from doing these things.

As described here, the Python API aims to be close to the REST API which no magic happening in the background. In short: as the REST API allows this, so does the Python API.

But I do get the point - I'll take this and will think of a nice way to make this clearer to the users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants