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

Code Review gerrit at ovirt.org
Wed Mar 8 11:31:08 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>
---
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
  Juan Hernandez: Looks good to me, but someone else must approve
  Jenkins CI: Passed CI tests



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic16624d6e49155ef21160bc8570a55e7d1610cd9
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine-sdk-java
Gerrit-Branch: master
Gerrit-Owner: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Ondra Machacek <omachace at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list