Add Member to Custom Group

Use the Add Member to Custom Group operation to add a member to a custom group. This operation is supported using the BCPii interface.

HTTP method and URI

POST /api/groups/{group-id}/operations/add-member

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

Request body contents

The request body is expected to contain a JSON object with the following fields:

Field name Type Rqd/Opt Description
object-uri String Required The object URI of the object to be added to the group

Description

If successful, the managed object designated in the request body attains membership in the custom group identified by {group-id}.

The operation is subject to the following restrictions:

  • The designated managed object must exist and must not already be a member of the group identified by {group-id}
  • The group identified by {group-id} must be a custom group defined without a pattern-matching specification.

Authorization requirements

This operation has the following authorization requirements:
  • For the web services interface:
    • Object-access permission to the custom Group object designated by {group-id}
    • Object-access permission to the object designated by the request body
    • Action/task permission for the Grouping task.
  • For the BCPii interface the source partition must have receive BCPii security controls permissions for the CPC object and the object designated by the request body.

HTTP status and reason codes

On success, HTTP status code 204 (No Content) is returned and no response body is provided.

On error, appropriate HTTP status codes are returned for the indicated errors, and 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.
291 The designated managed object is already a member of the custom group identified by {group-id}.
294 The group identified by {group-id} was defined using pattern-matching.
403 (Forbidden) 1 The user under which the API request was authenticated does not have the required authority to perform this operation.
293 The addition of the member to the custom group designated by the URI ({group-id}) would introduce a circular reference, which is not permitted.
404 (Not Found) 1 The URI's {group-id} does not designate an existing custom Group object, or the API user does not have object-access to the group.
2 The request body does not designate an existing managed object, or the API user does not have sufficient access to the managed object.
500 (Server Error) 273 An unexpected error occurred during the operation.

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

Example HTTP interaction

Figure 1. Add Member to Custom Group: Request
POST /api/groups/ee2782af-dd98-3ec0-bc2d-cfe2e9154341/operations/add-member HTTP/1.1
x-api-session: 42r6t4chltipvd6l4l61wi3111tf7fv2hes80hjqjs3invt7cp
content-type: application/json
content-length: 78
{
   "object-uri": "/api/logical-partitions/588d8c18-0db7-11e1-b1f1-f0def14b63af"
}
Figure 2. Add Member to Custom Group: Response
204 No Content
date: Fri, 25 Nov 2011 16:45:44 GMT
server: zSeries management console API web server / 1.0
cache-control: no-cache

<No response body>