Juan Hernandez 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)
nics.each do |nic|
puts "nic: #{nic.name}"
end
Change-Id: I33adfd45183838f81873ab70fade92c8d89e9c44
Related-To:
https://bugzilla.redhat.com/1349857
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
---
M generator/src/main/java/org/ovirt/sdk/ruby/ReadersGenerator.java
M sdk/examples/follow_vm_links.rb
M sdk/lib/ovirtsdk4/http.rb
M sdk/spec/vm_reader_spec.rb
4 files changed, 163 insertions(+), 8 deletions(-)
Approvals:
Ondra Machacek: Looks good to me, but someone else must approve
Juan Hernandez: Verified; Looks good to me, approved
Jenkins CI: Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/60010
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I33adfd45183838f81873ab70fade92c8d89e9c44
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine-sdk-ruby
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Ondra Machacek <omachace(a)redhat.com>