Sorting resource lists

You can retrieve a sorted list of items of a particular resource type by specifying the property you want to sort by and the sort order in the GET request. You can sort tenants and namespaces by name or by hard quota. You can sort user accounts by username.

To specify a sort property and sort order, you use these query parameters in the GET request:

sortType=property-name specifies the property you want to sort by. Valid values are:

oFor the tenants, namespaces, and dataAccessPermissions resources, name and hardQuota

oFor the userAccounts resource, username

This parameter is optional. For the tenants, namespaces, and dataAccessPermissions resources, the default is name.

sortOrder=(ascending|descending) specifies the order in which to sort the listed items.

This parameter is optional. The default is ascending.

For example, this GET request sorts the list of tenants defined in the HCP system in descending order by hard quota:

curl -k -i -H "Accept: application/xml"
    -H "Authorization: HCP YWxscm9sZXM=:04EC9F614D89FF5C7126D32ACB448382"    "https://admin.hcp.example.com:9090/mapi/tenants?sortType=hardQuota
         &sortOrder=descending&prettyprint"

These considerations apply to sorting resource lists:

The sortType and sortOrder parameters are valid only with the tenants, namespaces, userAccounts, and dataAccessPermissions resources.

You can page, sort, and filter resource lists in the same request. For information on paging, see Paging through the resource listsFor information on filtering, see Filtering resource lists.

Trademark and LegalDisclaimer

© 2016 Hitachi Data Systems Corporation. All rights reserved.