Use the
compact request parameter in a collection or instance query to omit metadata from each instance in the response. When you set
compact=true, only the "content" component is returned at the instance level. The
compact request parameter does not affect metadata at the collection level, so the collection-level "@base," "links," and "updated," components are still returned when
compact=true.
Using the
compact request parameter can save bandwidth and processing on both ends of the client/server connection. For this reason, it is recommended that you always use the
compact request parameter on queries, unless you need the collection-level hyperlinks.
Syntax
As the first parameter on the request URI:
?compact=<bool_value>
As a subsequent parameter on the request URI:
&compact=<bool_value>
where valid values for
<bool_value> are:
true - Eliminates the "@base,"
"links", and
"updated" components from the instance level in the response.
false - (Default) Returns all metadata, including instance-level metadata.
Examples
The following request omits metadata from the returned alert resource type instances:
Header
Accept: application/json
Request
GET https://10.108.53.216/api/types/alert/instances?fields=severity,component,message,resolution&compact=true
Response
{
"@base": "https://10.108.53.216/api/types/alert/instances?filter=severity eq 3&fields=severity,component,message,resolution,id&per_page=2000&compact=true",
"updated": "2015-10-28T13:01:50.054Z",
"links": [
{
"rel": "self",
"href": "&page=1"
}
],
"entries": [
{
"content": {
"id": "alert_4",
"severity": 3,
"component": {
"id": "nas_4",
"resource": "nasServer"
},
"message": "All DNS servers configured for DNS client of NAS server DHWindows2 are not reachable.",
"resolution": "0"
}
},
{
"content": {
"id": "alert_7",
"severity": 3,
"component": {
"id": "nas_6",
"resource": "nasServer"
},
"message": "All LDAP servers configured for LDAP client of NAS server DHWindows3 are not reachable.",
"resolution": "0"
}
}
]
}
Data is not available for the Topic
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please provide ratings (1-5 stars).
Please select whether the article was helpful or not.
Comments cannot contain these special characters: <>()\