Change in ovirt-engine-sdk[sdk_4.0]: Add support for following links to lists

omachace at redhat.com omachace at redhat.com
Fri Jul 1 08:33:21 UTC 2016


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 at redhat.com>
(cherry picked from commit a5f6e0713a29abe3ad9868a2aa1f83f07e6eadfa)
---
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
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/60076
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a928cb2031318b5e8a1bc74ac2f23fe268cecbe
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: sdk_4.0
Gerrit-Owner: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondra Machacek <omachace at redhat.com>



More information about the Engine-commits mailing list