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

Code Review gerrit at ovirt.org
Fri Feb 24 13:53:25 UTC 2017


>From Ondra Machacek <omachace at 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 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(types.Vm())

Change-Id: I465788b9a36167338eb21f0a4c8a40f3d2d570de
Signed-off-by: Ondra Machacek <omachace at redhat.com>
(cherry picked from commit 103680e08ec870eb7ac3cd946c94c7c978d09afe)
---
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
  Jenkins CI: Passed CI tests



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I465788b9a36167338eb21f0a4c8a40f3d2d570de
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: sdk_4.1
Gerrit-Owner: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list