Ondra Machacek has submitted this change and it was merged.
Change subject: Add support for following links to lists
......................................................................
Add support for following links to lists
Currently the "follow_link" method of the "Conection" class only
supports links to single objects, but not links to list of objects. This
patch changes the SDK so that it will also support this kind of links.
For example, when a VM is retrieved it will include links to its NICs:
<vm id="123" href="/vms/123">
<link rel="nics" href="/vms/123/nics"/>
...
</vm>
The SDK will process this "link" element and store it in the
"vm.nics"
property of the created object. Later, the user will be able to use the
"follow_link" method to retrieve that list:
vm = ...
nics = connection.follow_link(vm.nics)
for nic in nics:
print("nic: %s" % nic.name)
Change-Id: I1a928cb2031318b5e8a1bc74ac2f23fe268cecbe
Signed-off-by: Ondra Machacek <omachace(a)redhat.com>
---
M generator/src/main/java/org/ovirt/sdk/python/ReadersGenerator.java
M sdk/examples/follow_vm_links.py
M sdk/lib/ovirtsdk4/__init__.py
A sdk/tests/test_read_link.py
4 files changed, 210 insertions(+), 4 deletions(-)
Approvals:
Ondra Machacek: Verified; Looks good to me, approved
Juan Hernandez: Looks good to me, but someone else must approve
Jenkins CI: Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/60019
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1a928cb2031318b5e8a1bc74ac2f23fe268cecbe
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Ondra Machacek <omachace(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Ondra Machacek <omachace(a)redhat.com>