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

Code Review gerrit at ovirt.org
Wed Mar 8 11:58:55 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 = connection()
      .url("https://engine40.example.com/ovirt-engine/api")
      .user("username at domain")
      .password("password")
      .trustStoreFile("truststore.jks")
      .header("My", "Header")
      .build();

  # Get the reference to the service that manage the collection
  # of virtual machines and add virtual machine:
  VmsService vmsService = connection.systemService().vmsService();
  vmsService.add().vm(vm(...)).send()

Change-Id: Ic16624d6e49155ef21160bc8570a55e7d1610cd9
Signed-off-by: Ondra Machacek <omachace at redhat.com>
(cherry picked from commit 75a471c52e0ad52d0a0cad156c9d01eb4aceb45d)
---
M generator/src/main/java/org/ovirt/sdk/java/ServicesImplGenerator.java
A sdk/src/main/java/org/ovirt/engine/sdk4/BaseRequest.java
M sdk/src/main/java/org/ovirt/engine/sdk4/ConnectionBuilder.java
M sdk/src/main/java/org/ovirt/engine/sdk4/Request.java
M sdk/src/main/java/org/ovirt/engine/sdk4/internal/HttpConnection.java
A sdk/src/test/java/org/ovirt/engine/sdk4/GlobalHeadersTest.java
M sdk/src/test/java/org/ovirt/engine/sdk4/ServerTest.java
7 files changed, 196 insertions(+), 2 deletions(-)

Approvals:
  Ondra Machacek: Verified; Looks good to me, approved
  Jenkins CI: Passed CI tests



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic16624d6e49155ef21160bc8570a55e7d1610cd9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk-java
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