Reference Guide

"state": "Cleared"
}
]
Including data from a related resource type in a query
You can extend the scope of a collection query to retrieve data from a related resource type. The REST model describes two
kinds of relations:
A referenced resource type
An embedded resource type
Referenced resource types
A referenced resource type describes an instance of a linked object type. This resource type is declared in the REST model as a
reference to an object (for a many-to-one relation) or an array of objects (for a one-to-many or many-to-many relation). To
return information about instances and their related instances, use the following syntax in the select parameter to specify the
desired attributes from the related resource type:
...<attribute1>,<attribute2>,<related_resource> (id,related_attribute2,
related_attribute3...)
If you omit the list of parameters, only the select attribute and its value are returned for the referenced object:
...<attribute1>,<attribute2>,<related_resource>
Examples
The following queries use the select request parameter to return information about nodes and their related appliances.
Returning specified parameters for the appliance related to each node
Headers
Accept: application/json
Authorization: <auth_cookie>
Request
https://1.2.3.4/api/rest/node?select=id,name,appliance(id,name)
Response
body
[
{
"id":"N1",
"name":"H0112-appliance-1-node-A",
"appliance":
{
"id":"A1",
"name":"H0112-appliance-1"
}
},
{
"id":"N2",
"name":"H0112-appliance-1-node-B",
"appliance":
{
"id":"A1",
"name":"H0112-appliance-1"
}
}
]
Querying a resource 31