Group Membership

Consumers can be associated and unassociated with any existing consumer group at any time using the following REST API.

Associate a Consumer with a Group

Associate the consumers specified by the Search Criteria with a consumer group. This call is idempotent; if a consumer is already a member of the group, no changes are made and no error is raised.

Method: POST
Path: /pulp/api/v2/consumer_groups/<consumer_group_id>/actions/associate/
Permission: execute
Request Body Contents:
  • criteria (object) - criteria used to specify the consumers to associate

Response Codes:
  • 200 - the consumers were successfully associated

  • 400 - if one or more of the parameters is invalid

  • 404 - if the group does not exist

Return: array of consumer IDs for all consumers in the group

Sample Request:

{
 "criteria": {
   "filters": {
     "id": {
       "$in": [
         "lab1",
         "lab2"
       ]
     }
   }
 }
}

Sample 200 Response Body:

["lab0", "lab1", "lab2"]

Unassociate a Consumer from a Group

Unassociate the consumers specified by the Search Criteria from a consumer group. If a consumer satisfied by the criteria is not a member of the group, no changes are made and no error is raised.

Method: POST
Path: /pulp/api/v2/consumer_groups/<consumer_group_id>/actions/unassociate/
Permission: execute
Request Body Contents:
  • criteria (object) - criteria used to specify the consumers to associate

Response Codes:
  • 200 - the consumers were successfully unassociated

  • 400 - if one or more of the parameters is invalid

  • 404 - if the group does not exist

Return: array of consumer IDs for all consumers in the group

Sample Request:

{
 "criteria": {
   "filters": {
     "id": {
       "$in": [
         "lab1",
         "lab2"
       ]
     }
   }
 }
}

Sample 200 Response Body:

["lab0"]