From Ondra Machacek <omachace(a)redhat.com>:
Ondra Machacek 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 = Connection(
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(types.Vm())
Change-Id: I465788b9a36167338eb21f0a4c8a40f3d2d570de
Signed-off-by: Ondra Machacek <omachace(a)redhat.com>
---
M sdk/lib/ovirtsdk4/__init__.py
M sdk/tests/server.py
M sdk/tests/test_vm_service.py
3 files changed, 49 insertions(+), 3 deletions(-)
Approvals:
Ondra Machacek: Verified; Looks good to me, approved
Juan Hernandez: Looks good to me, but someone else must approve
Jenkins CI: Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/73004
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I465788b9a36167338eb21f0a4c8a40f3d2d570de
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Ondra Machacek <omachace(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>