List Capacity Groups of a CPC

The List Capacity Groups of a CPC operation lists the defined capacity groups for the specified CPC.

HTTP method and URI

GET /api/cpcs/{cpc-id}/capacity-groups

In this request, the URI variable {cpc-id} is the object ID of the CPC.

Query parameters:

Name Type Rqd/Opt Description
name String Optional Filter pattern (regular expression) to limit returned objects to those that have a matching name property.

Response body contents

On successful completion, the response body is a JSON object with the following fields:

Field name Type Description
capacity-groups Array of capacity-group-info objects Array of capacity-group-info objects, described in the next table. Returned array may be empty.

Each nested capacity-group-info object contains the following fields:

Field name Type Description
element-uri String/ URI Canonical URI path of the Capacity Group object. More details about this capacity group can be fetched using this element-uri.
name String (1-64) The name of the capacity group.

Description

This operation lists the capacity groups that are defined for the specified CPC. The element-uri and name are returned for each capacity group.

If the name query parameter is specified for the request, the returned list is limited to the Capacity Group elements that have a name matching the specified filter pattern. If no match is found, then the response will be an empty array. If the parameter is not specified, all the Capacity Group elements are returned.

The response could be an empty array, if the CPC does not have a Capacity Group associated with it or if the CPC is not in DPM mode.

The URI path must designate an existing CPC, and the API user must have object-access permission to the CPC object specified by the {cpc-id}. If these conditions are not met, HTTP status code 404 (Not Found) is returned.

Authorization requirements

This operation has the following authorization requirement:
  • Object-access permission to the specified CPC.

HTTP status and reason codes

On success, HTTP status code 200 (OK) is returned and the response body is provided as described in Response body contents.

Otherwise, the following HTTP status codes are returned for the indicated errors. The response body is a standard error response body providing the reason code indicated and any associated error message.

HTTP error status code Reason code Description
400 (Bad Request) Various Errors were detected during common request validation. See Common request validation reason codes for a list of the possible reason codes.
404 (Not Found) 1 The CPC identified by {cpc-id} does not exist or the user does not have object-access permission to it.
409 (Conflict) 329 The operation cannot be performed because the CPC designated by the request URI is an unmanaged CPC, which is not supported by this operation.

Additional standard status and reason codes can be returned, as described in Invoking API operations.

Example HTTP interaction

Figure 1. List Capacity Groups of a CPC: Request
GET /api/cpcs/3baea1ec-76e8-3e42-a111-815a7aee19e0/capacity-groups HTTP/1.1
x-api-session: 4xjbyzz8iip3fv0j77gyuk3e6r7lp0pl9yb4zfpf1n46u3z7ec
Figure 2. List Capacity Groups of a CPC: Response
200 OK
server: zSeries management console API web server / 2.0
cache-control: no-cache
date: Mon, 22 Feb 2016 10:00:54 GMT
content-type: application/json;charset=UTF-8
content-length: 363
{
   "capacity-groups":[
      {
         "element-uri":"/api/cpcs/3baea1ec-76e8-3e42-a111-815a7aee19e0/capacity-groups/e0118d40-
            d088-11e5-a631-42f2e9ef1641",
         "name":"Test18311"
      },
      {
         "element-uri":"/api/cpcs/3baea1ec-76e8-3e42-a111-815a7aee19e0/capacity-groups/d95f6418-
            d6eb-11e5-92b9-42f2e9ef1641",
         "name":"myNewGroup1"
      }
   ]
}