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

Aggregating response data

Use the groupby request parameter to group specified values and apply the aggregate function @sum to each group. The groupby parameter works like an SQL Group By clause.

NOTE You can use @sum without the groupby parameter, if you are grouping by the id attribute of a resource.

Syntax

As the first parameter on the request URI: ?groupby=<groupby_expr>

As a subsequent parameter on the request URI: &groupby=<groupby_expr>

where <groupby_expr> is defined by the following syntax using Backus-Naur Form (BNF):

groupby_expr ::= sub_groupby_expr
             | groupby_expr ‘,’ sub_groupby_expr
             
sub_groupby_expr ::= prop_expr

In the syntax for <groupby_expr>, prop_expr is the name of an attribute. Its type can be int,float, string, InetSocketAddress, Date, Boolean, Enum, or a list whose element is among the above types.

NOTE You can use dot notation syntax (resource_type.attribute) in a groupby expression to group the response data by attributes from a related resource type. A related resource type is a resource type that is either referred to explicitly in the definition of the target resource type or embedded in the target resource type.

Example - Summarizing the size and rawSize of drives grouped by drive type

The following request returns a summary of size and rawSize of drives based on the type to which they belong.

Header
Accept: application/json
Content-Type: application/json
Request
GET https://10.108.53.216/api/types/disk/instances?fields=diskTechnology,abc::@sum(size),def::@sum(rawSize)&groupby=diskTechnology"&compact=true
Response
{
  "@base": "https://10.103.75.136/api/types/disk/instances?fields=type,abc::@sum(size),def::@sum(rawSize)&groupby=type",
  "updated": "2014-05-30T06:57:24.045Z",
  "links": [
    {"rel": "self",
      "href": "&page=1"
    }
  ]
  "entries": [
    {
      "updated": "2015-11-12T10:07:05.467Z",
      "content": {
         "diskTechnology": 1,
         "abc": 285741154304,
         "def": 381681664000
         }
    }
  ]
}

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: <>()\