Change in ovirt-engine-sdk-ruby[master]: Add support for custom headers and query parameters

Code Review gerrit at ovirt.org
Tue Feb 14 18:54:08 UTC 2017


>From Juan Hernandez <juan.hernandez at redhat.com>:

Juan Hernandez has submitted this change and it was merged.

Change subject: Add support for custom headers and query parameters
......................................................................


Add support for custom headers and query parameters

Currently there is no way to send to the server custom headers or query
parameters. This patch adds support for that. For example, if the
caller, for whatever the reason, needs to send the 'My: myvalue' header
and the 'your=yourvalue' query parameter to the request to add a virtual
machine, it can be done as follows:

  # Get the reference to the service that managse the collection
  # of virtual machines:
  vms_service = connection.system_service.vms_service

  # Add the virtual machine, with a custom
  vms_service.add(
    OvirtSDK4::Vm.new,
    headers: { my: 'myvalue' },
    query: { your: 'yourvalue' }
  )

Change-Id: I7f694bbff3889a62169eae894e2ba1071780237a
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M generator/src/main/java/org/ovirt/sdk/ruby/ServicesGenerator.java
M sdk/spec/spec_helper.rb
M sdk/spec/vm_service_spec.rb
M sdk/spec/vms_service_spec.rb
4 files changed, 191 insertions(+), 9 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/72040
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f694bbff3889a62169eae894e2ba1071780237a
Gerrit-PatchSet: 2
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: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list