Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Add expand and attributes to get and filter methods #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wakemaster39
Copy link

I have ran into the problem numerous times where I need to .get(id=XXX) or some filter but I also want some extended attributes on the objects. The way the current structure is laid out, I can get the results. These results are then all loaded with data.

As I iterate through my results I need to call reload(expand=xxx,attributes=yyyy).

These change adds support for expand and attributes to search results so that the secondary reload is not required.

Side effect of using expand is you get additional Entities on the object. These objects when accessed are type dict and not type Entity which causes a difference in usage of the api.

As an example when I query a service and expand vms, I can call service.vms and it will return type List[dict]. With the changes here it will look to see if the object has an href property. If it does, it will wrap it up as an Entity so service.vms will return type List[Entity] and allow familiar usage of the api.

Cameron Hurst added 2 commits July 14, 2018 18:24
Also added support for wrapping list of dictionaries that are
manageiq objects on Entity reload. This helps with things like when
you expand and get a list of dictionaries back. These are now
wrapped as entities that you can work with rather than dictionaries.

Added the same thing for dictionaries as well.
@mfeifer
Copy link

mfeifer commented Jan 23, 2020

@mshriver

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

Successfully merging this pull request may close these issues.

3 participants