Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1194218

Summary: [REGENERATE JAVA SDK] Document All-Content header in RSDL and add it to SDKs
Product: [Retired] oVirt Reporter: Juan Hernández <juan.hernandez>
Component: ovirt-engine-sdk-javaAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Antonin Pagac <apagac>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5CC: bugs, ecohen, gklein, juan.hernandez, lsurette, msivak, pstehlik, rbalakri, yeylon
Target Milestone: ---   
Target Release: 3.5.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: ovirt-engine-sdk-java-3.5.2.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1194185 Environment:
Last Closed: 2015-04-29 06:16:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1194185    
Bug Blocks: 1193058    

Description Juan Hernández 2015-02-19 10:59:19 UTC
+++ This bug was initially created as a clone of Bug #1194185 +++

Description of problem:

Some information is hidden from REST unless All-Content is set, but the header is not documented and the SDK does not support it.

One example is HA score (hosted engine) of a Host. It is set in org.ovirt.engine.api.restapi.resource.BackendHostResource#doPopulate and not present in HostMapper.

There is no way to get this data using Java SDK.

Version-Release number of selected component (if applicable):

oVirt 3.4, oVirt 3.5 components (engine, Java SDK)

How reproducible:

Always.

Additional info:

I consider HA score to be important value and I would prefer if it was always present. But that is another issue. Also the All-Content header is not properly documented anywhere and if it is then our documentation is a mess...

Comment 1 Antonin Pagac 2015-03-26 10:14:43 UTC
ovirt-engine-sdk-java-3.5.2.0.jar

I am able to query the engine from the SDK with the All-Content header using method:

List<org.ovirt.engine.sdk.decorators.Host> list(String query, Boolean caseSensitive, Integer max, String allContent)

which looks something like this:

List<Host> hostsWithHeader = api.getHosts().list(null, null, null, "true");


However, I am unable to query the engine with the header using the "get" method. Also, I am not sure how to find out if the header actually changed something in the resulted data.

Juan, can you please advise?

Comment 2 Juan Hernández 2015-03-26 14:18:48 UTC
The get methods of collections in the Java SDK don't support any parameter other than the name or identifier of the entity. This is for any collection, not only for hosts. If you think that this needs to be changed please open a RFE.

Currently the only extra information that is added to the host when the "All-Content: true" header is used is the hosted engine information. So to notice the difference you will have to use hosted engine and then call the method that returns the hosted engine data. For example, to get the hosted engine score:

  HostedEngine hostedEngine = host.getHostedEngine();
  if (hostedEngine != null) {
    System.out.println("score: " + hostedEngine.getScore());
  }

Without the header (or with value "false") this will always return "null", with the header (and value "true") it will return the hosted engine data (only if using hosting engine).

Comment 3 Antonin Pagac 2015-03-26 14:48:19 UTC
I tried this with a hosted engine and successfully got a Score value. Thank you Juan.

Verified.

Comment 4 Eyal Edri 2015-04-29 06:16:47 UTC
ovirt 3.5.2 was GA'd. closing current release.