You can extend the scope of a collection query to retrieve data from a related resource type. Access to data from a related resource type is supported for the following scenarios:
A resource type referenced explicitly by the target resource. For example, the
pool attribute of the
fileystem resource type has the data type pool, which is defined by the
pool resource type. Therefore, you can create a collection query for
filesystem that returns data from
filesystem instances and related
pool instances.
An embedded resource type. For example, the
poolTier resource type is embedded into the
pool
resource type. Therefore, you can create a collection query for a pool that returns data from
pool instances and related
poolTier instances.
To create an extended query, use dot notation syntax within the
fields,
filter, or
orderby request parameters to specify the desired attributes from related resource types.
For example, to obtain information about file systems, including the health of their associated pools, create a collection query for the
filesystem resource type that has a
fields,
filter, or
orderby request parameter. In the parameter expression, reference the
health attribute in the
pool resource type as follows:
pool.health
Example 1: Extending queries using the fields request parameter
The following query uses the fields request parameter to return information about drives and their parent DPEs. It retrieves values for the
id and
name attributes for all
disk instances and values from the
id and
name attributes from the related
dpe instances.
disk instances are related to
dpe instances through the
disk resource type's
parentDpe attribute, which references the
dpe resource type.
Example 2: Extending queries using the filter request parameter
The following query uses the
filter request parameter to return information about all alerts whose component name is
nasServer. It retrieves values for the
id,
severity,
component, and
message attributes for the
alert instances that meet this criteria and values from the
id
and
resource attributes from the related
resourceRef instances.
Header
Accept: application/json
Request
GET https://10.108.53.216/api/types/alert/instances?fields=severity,component,message,component.resource&filter=component.resource eq "nasServer"
Example 3: Extending queries using the orderby request parameter
The following query uses the
orderby request parameter to sort returned data by the name of the parent DPE. It retrieves values for the
id and
name attributes for all
disk instances and values for the
id
attribute of the
dpe instance.
Header
Accept: application/json
Request
GET https://10.108.53.216/api/types/disk/instances?fields=id,name,parentDpe.name &orderby=parentDpe.name&compact=true