From Juan Hernandez <juan.hernandez(a)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@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(a)redhat.com>
Signed-off-by: Ondra Machacek <omachace(a)redhat.com>
---
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:
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/73045
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I53a67698e3c260b6721d62c8b5c51368ad561079
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>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>