From Ondra Machacek <omachace(a)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@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(a)redhat.com>
---
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
Juan Hernandez: Looks good to me, but someone else must approve
Jenkins CI: Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/73648
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0d2ac733f5f0952b5ad384aaddae080c1ff491bc
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine-sdk-java
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>