Change in ovirt-engine-sdk-ruby[master]: Add support for "Get" and "List" parameters

juan.hernandez at redhat.com juan.hernandez at redhat.com
Wed Jan 13 17:11:17 UTC 2016


Juan Hernandez has submitted this change and it was merged.

Change subject: Add support for "Get" and "List" parameters
......................................................................


Add support for "Get" and "List" parameters

Some of the "Get" and "List" operations of the API support parameters.
For example, the operation to list virtual machines supports the
"search" parameter. This patch adds support for this kind of parameters,
so that this, for example, will work:

  # Create the connection:
  connection = Ovirt::SDK::V4Connection.new({
    :url => 'https://engine.example.com/ovirt-engine/api',
    :username => 'admin at internal',
    :password => '...',
    :ca_file => 'ca.pem',
  })

  # Get the VMs service:
  vms_service = connection.system.vms

  # Search for VMs with a given name and print their id:
  vms = vms_service.list({:search => 'name=myvm'})
  vms.each do |vm|
    puts vm.id
  end

  # Close the connection:
  connection.close

The patch also improves the tests so that this support is better tested.

Change-Id: I0f1fe53af1f81a29c72c4a5ab99f88d4ceda3e1b
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M README.md
M generator/src/main/java/org/ovirt/sdk/ruby/ServicesGenerator.java
M pom.xml
M sdk/examples/list_vms.rb
A sdk/examples/search_vms.rb
M sdk/lib/ovirt/sdk/v4.rb
M sdk/lib/ovirt/sdk/v4/connection.rb
A sdk/lib/ovirt/sdk/v4/xml_formatter.rb
A sdk/spec/connection_spec.rb
A sdk/spec/parameters.yaml
M sdk/spec/spec_helper.rb
A sdk/spec/vms_service_spec.rb
A sdk/spec/xml_formatter_spec.rb
13 files changed, 695 insertions(+), 10 deletions(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved; Passed CI tests



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0f1fe53af1f81a29c72c4a5ab99f88d4ceda3e1b
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine-sdk-ruby
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list