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

Code Review gerrit at ovirt.org
Wed Mar 8 12:07:00 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 headers and query parameters
......................................................................


Add support for custom headers and query parameters

Currently there is no way to send to the server custom headers or query
parameters. This patch adds support for that. For example, if the
caller, for whatever the reason, needs to send the 'My: myvalue' header
and the 'your=yourvalue' query parameter to the request 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")
       .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(...))
     .header("My", "Header")
     .query("Some", "Value")
     .send()

Change-Id: I0d2ac733f5f0952b5ad384aaddae080c1ff491bc
Signed-off-by: Ondra Machacek <omachace at redhat.com>
(cherry picked from commit 6ce7557f29bbb1105b37ad3ddee32599505a94c9)
---
M generator/src/main/java/org/ovirt/sdk/java/ServicesImplGenerator.java
M sdk/src/test/java/org/ovirt/engine/sdk4/GlobalHeadersTest.java
M sdk/src/test/java/org/ovirt/engine/sdk4/VmsServiceTest.java
3 files changed, 95 insertions(+), 2 deletions(-)

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



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0d2ac733f5f0952b5ad384aaddae080c1ff491bc
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