+++ 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...
Requests sent to the RESTAPI server can optionally contain the "All-Content" header: GET /ovirt-engine/api/hosts/{host:id} HTTP/1.1 All-Content: true ... When the content isn't sent the default is "false". In general the effect of this header is to request additional data that is usually not interesting or expensive to obtain. For example, when requesting a host (or list of hosts) the caller isn't interested in the hosted engine related data, so it won't be retrieved or returned: GET /ovirt-engine/api/hosts/{host:id} HTTP/1.1 ... HTTP/1.1 200 Ok <host id="..."> <name>myhost</name> <!-- Note that no hosted engine information is provided. --> ... </host> If the user is interested in that additional data it can be requested adding the header: GET /ovirt-engine/api/hosts/{host:id} HTTP/1.1 All-Content: true ... HTTP/1.1 200 Ok <host id="..."> <name>myhost</name> <hosted_engine> <configured>true</configured> <active>true</active> <score>3</score> ... </hosted_engine> ... </host> The availability of the "All-Content" header is documented in the RSDL metadata that can be obtained from the live engine: GET /ovirt-engine/api?rsdl HTTP/1.1 HTTP/1.1 200 Ok <rsdl href="/ovirt-engine/api?rsdl" rel="rsdl"> ... </rsdl> This RSDL document describes which links support the header. For example, for virtual machines: <link href="/ovirt-engine/api/vms" rel="get"> <description>get all the virtual machines in the system</description> <request> <http_method>GET</http_method> <headers> <header required="false"> <name>All-Content</name> <value>true|false</value> </header> ... </headers> <link> When the header is available in a link it can be used in the Python SDK with the "all_content" parameter. For example, to get all the content of a VM: api.vms.get(name="myvm", all_content=True) In the Java SDK the name of the parameter is "allContent". What additional information is added is specific to each entity.
Re-targeting to 3.5.3 since this bug has not been marked as blocker for 3.5.2 and we have already released 3.5.2 Release Candidate.
Why don't wee show all the content by default? Why do we need this option?
Because computing all the content is expensive, and useless in most cases.
(In reply to Juan Hernández from comment #5) > Because computing all the content is expensive, and useless in most cases. Can't we alert the user of this option within the API?
How do you suggest to do that?
(In reply to Juan Hernández from comment #7) > How do you suggest to do that? Add this info on the returned info that more data can be pulled with this header.
I don't think that belongs into the RESTAPI, rather into the documentation. If you still think that such a thing should be part of the RESTAPI please open RFE and describe how you want it to work.
Added an entry in the revision history topic and moving this bug to VERIFIED.
This content is now live on the Customer Portal in the REST API Guide. Closing.