Change in ovirt-engine-sdk-ruby[sdk_4.0]: Add support for custom global headers

Code Review gerrit at ovirt.org
Mon Feb 27 11:19:11 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 global headers
......................................................................


Add support for custom global headers

Currently there is no way to have global custom headers. This patch adds
support for that. For example, if the caller, for whatever the reason,
needs to send the 'My: myvalue' header  to add a virtual
machine, it can be done as follows:

  connection = OivrtSDK4::Connection.new(
    url: 'https://engine/ovirt-engine/api',
    username: 'username at domain',
    password: 'password',
    ca_file: 'ca.pem',
    headers: { my: 'myvalue' }
  )

  # Get the reference to the service that manage the collection
  # of virtual machines and add virtual machine:
  vms_service = connection.system_service.vms_service
  vms_service.add(OvirtSDK4::Vm.new)

Change-Id: I53a67698e3c260b6721d62c8b5c51368ad561079
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
Signed-off-by: Ondra Machacek <omachace at redhat.com>
(cherry picked from commit 7f5f30da4da30c9b20093d9cc9c5dc3c61062a5d)
(cherry picked from commit 0e88b92919c001479be4492764adee41f421c3bd)
---
M sdk/lib/ovirtsdk4/connection.rb
A sdk/spec/global_headers_spec.rb
M sdk/spec/spec_helper.rb
3 files changed, 110 insertions(+), 3 deletions(-)

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



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I53a67698e3c260b6721d62c8b5c51368ad561079
Gerrit-PatchSet: 1
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>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list