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

juan.hernandez at redhat.com juan.hernandez at redhat.com
Thu Jun 30 12:45:38 UTC 2016


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 at redhat.com>
(cherry picked from commit fea6ddb71cf6c1756fe3e84c008bd43915bb05a5)
---
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:
  Juan Hernandez: Verified; Looks good to me, approved
  Jenkins CI: Passed CI tests



-- 
To view, visit https://gerrit.ovirt.org/60015
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: sdk_4.0
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>



More information about the Engine-commits mailing list