Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Dell Unity™ Family Unisphere® Management REST API Programmer's Guide

PDF

Extending queries to include related data

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.

Header
Accept: application/json
Request
https://10.108.53.216/api/types/disk/instances ?fields=name,pool,parentDpe,parentDpe.name&compact=true
Response
{
  "@base": "https://10.108.53.216/api/types/disk/instances?fields=name,parentDpe.name,id,pool.id,parentDpe.id,parentDpe.id&per_page=2000&compact=true",
  "updated": "2015-10-28T15:12:40.655Z",
  "links": [
    {
      "rel": "self",
      "href": "&page=1"
    }
  ],
  "entries": [
    {
      "content": {
        "id": "dpe_disk_0",
        "name": "DPE Disk 0",
        "parentDpe": {
          "id": "dpe",
          "name": "DPE_1"
        }
      }
    },
    {
      "content": {
        "id": "dpe_disk_1",
        "name": "DPE Disk 1",
        "parentDpe": {
          "id": "dpe",
          "name": "DPE_2"
        }
      }
    },

.
.
.

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"
Response
{
  "@base": "https://10.108.53.216/api/types/alert/instances?filter=component.resource eq \"nasServer\"&fields=severity,component,message,component.resource,id&per_page=2000",
  "updated": "2015-10-28T19:04:21.310Z",
  "links": [
    {
      "rel": "self",
      "href": "&page=1"
    }
  ],
  "entries": [
    {
      "@base": "https://10.108.53.216/api/instances/alert",
      "updated": "2015-10-28T19:04:21.310Z",
      "links": [
        {
          "rel": "self",
          "href": "/alert_3"
        }
      ],
      "content": {
        "id": "alert_3",
        "severity": 6,
        "component": {
          "id": "nas_1",
          "resource": "nasServer"
        },
        "message": "Network interface N/A is operating normally"
      }
    },
    {
      "@base": "https://10.108.53.216/api/instances/alert",
      "updated": "2015-10-28T19:04:21.310Z",
      "links": [
        {
          "rel": "self",
          "href": "/alert_4"
        }
      ],
      "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."
      }
    },
.
.
.

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
Response
{
  "@base": "https://10.108.53.216/api/types/disk/instances?fields=id,name,parentDpe.name,parentDpe.id&orderby=parentDpe.name&per_page=2000&compact=true",
  "updated": "2015-10-28T18:09:32.692Z",
  "links": [
    {
      "rel": "self",
      "href": "&page=1"
    }
  ],
  "entries": [
    {
      "content": {
        "id": "disk_1",
        "name": "Disk 1",
        "parentDpe": {
          "id": "dpe",
          "name": "DPE_1"
        }
      }
    },
    {
      "content": {
        "id": "disk_0",
        "name": "Disk 0",
        "parentDpe": {
          "id": "dpe",
          "name": "DPE_2"
       }
      }
    },
    {
      "content": {
        "id": "disk_2",
        "name": "Disk 2",
        "parentDpe": {
          "id": "dpe",
          "name": "DPE_3"
        }
      }
    },

.
.
.

Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  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: <>()\