Create, Delete, and Update¶
Create a Consumer Group¶
Creates a new consumer group. Group IDs must be unique across all consumer groups defined on the server. A group can be initialized with an array of consumers by passing their IDs to the create call. Consumers can be added or removed at anytime using the membership calls.
Method: POST
Path: /pulp/api/v2/consumer_groups/
Permission: create
Request Body Contents:
- id (string) - unique identifier of the consumer group
- display_name (string) - (optional) display-friendly name for the consumer group
- description (string) - (optional) description of the consumer group
- consumer_ids (array) - (optional) array of consumer ids initially associated with the group
- notes (object) - (optional) key-value pairs associated with the consumer group
Response Codes:
- 201 - consumer group successfully created
- 400 - if one or more of the parameters is invalid
- 409 - if a consumer group with the given id already exists
Return: representation of the consumer group resource
Sample Request:
{
"id": "test-group",
"description": "A test group of consumers",
"consumer_ids": ["first-consumer", "second-consumer"]
}
Sample 201 Response Body:
{
"_id": {"oid": "50407df0cf211b30c37c29f4"},
"_ns": "consumer_groups",
"_href": "/v2/consumer_groups/test-group/",
"id": "test-group",
"display_name": null,
"description": "A test group of consumers",
"consumer_ids": ["first-consumer", "second-consumer"],
"notes": {}
}
Update a Consumer Group¶
Metadata about the consumer group itself (not the members) can be updated with this call. Consumer members can be added or removed at anytime using the membership calls.
Method: PUT
Path: /pulp/api/v2/consumer_groups/<consumer_group_id>/
Permission: update
Request Body Contents:
- display_name (string) - (optional) same as in create call
- description (string) - (optional) same as in create call
- notes (object) - (optional) same as in create call
Response Codes:
- 200 - if the update executed immediately and was successful
- 400 - if one or more of the parameters is invalid
- 404 - if the group does not exist
Return: updated representation of the consumer group resource
Sample Request:
{
"display_name": "new-name",
"description": "new-description",
"notes": {"new-note": "new-value"}
}
Sample 200 Response Body:
{
"scratchpad": null,
"display_name": "new-name",
"description": "new-description",
"_ns": "consumer_groups",
"notes": {"new-note": "new-value"},
"consumer_ids": [],
"_id": {"$oid": "5344df87e5e71066d17aa889"},
"id": "test-consumer-group",
"_href": "/pulp/api/v2/consumer_groups/test-consumer-group/"
}
Delete a Consumer Group¶
Deleting a consumer group has no effect on the consumers that are members of the group, apart from removing them from the group.
Method: DELETE
Path: /pulp/api/v2/consumer_groups/<consumer_group_id>/
Permission: delete
Response Codes:
- 200 - if the delete executed immediately and was successful
- 404 - if the specified group does not exist
Return: null