List Partitions of a CPC

The List Partitions of a CPC operation lists the partitions of a CPC.

HTTP method and URI

GET /api/cpcs/{cpc-id}/partitions

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

Query parameters:

Name Type Rqd/Opt Description
name String Optional A regular expression used to limit returned objects to those that have a matching name property.
status String Enum Optional Filter string to limit returned objects to those that have a matching status property. Value must be a valid partition status property value.
type String Enum Optional Filter string to limit returned objects to those that have a matching type property. Value must be a valid partition type property value.
additional-properties List of String Enum Optional A list of properties to be included in the response in addition to the default properties (name, object-uri, status, type). This is a list of comma-separated strings where each string is a property name defined in the Partition object's data model.

Response body contents

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

Field name Type Description
partitions Array of partition-info objects Array of nested partition-info objects, described in the next table.

Each nested partition-info object contains the following fields:

Field name Type Description
object-uri String/ URI Canonical URI path of the Partition object.
name String The name property of the Partition object.
status String Enum The status property of the Partition object.
type String Enum The type property of the Partition object.

Description

This operation lists the partition objects that belong to a CPC. The object URI, display name, status, and type are provided for each.

If the name query parameter is specified, the returned list is limited to those partition objects that have a name property matching the specified filter pattern. If the status query parameter is specified, the returned list is limited to those partition objects that have a status property matching the specified filter value. If the type query parameter is specified, the returned list is limited to those partition objects that have a type property matching the specified filter value. If no query parameters are provided, no filtering is done.

An object is only included in the list if the API user has object-access permission for that object.

If the additional-properties query parameter is specified, the response body is enhanced with the additionally requested properties. The presence and value of each requested property is the same as it would be in the response body of a Get Partition Properties operation. That is, it may be omitted or contain a special value, such as null, -1, or an empty string, if a prerequisite condition is not met. If the additional-properties query parameter is omitted, only the default properties are included in the response.

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

If the CPC is not in DPM mode, or there are no partitions defined to the CPC, or no partitions are to be included in the response due to filtering or access permissions, an empty list is provided and the operation completes successfully.

Authorization requirements

This operation has the following authorization requirements:
  • Object-access permission to the CPC object designated by {cpc-id}.
  • Object-access permission to any Partition object to be included in the result.

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.

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 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 request URI does not designate an existing resource of the expected type, or designates a resource for which the API user does not have object-access permission.
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 Partitions of a CPC: Request
GET /api/cpcs/93634ff4-0599-3f7d-b937-7673de7dfd0c/partitions?name=t.* HTTP/1.1
x-api-session: 2izurpik57ciomzst8z0q1vsqg2kuvfe9qxdja6irmbovo8z1c
Figure 2. List Partitions of a CPC: Response
200 OK
server: zSeries management console API web server / 2.0
cache-control: no-cache
date: Mon, 06 Feb 2017 09:08:33 GMT
content-type: application/json;charset=UTF-8
content-length: 504
{
 "partitions":[
  {
   "name":"testpweights",
   "object-uri":"/api/partitions/2fa1f646-e9d9-11e6-a392-42f2e9cfe851",
   "status":"stopped",
   "type":"ssc"
  },
  {
   "name":"testVnic",
   "object-uri":"/api/partitions/bc09b56e-e88b-11e6-8715-42f2e9cfe851",
   "status":"active",
   "type":"linux"
  },
  {
   "name":"testCrypto",
   "object-uri":"/api/partitions/798167ba-ec4a-11e6-a040-42f2e9cfe851",
   "status":"stopped",
   "type":"linux"
  },
  {
   "name":"test_ah",
   "object-uri":"/api/partitions/fd93be7e-e928-11e6-bcc9-42f2e9cfe851",
   "status":"stopped",
   "type":"ssc"
  }
 ]
}