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.
/pulp/api/v2/consumer_groups/<consumer_group_id>/actions/associate/
criteria (object) - criteria used to specify the consumers to associate
200 - the consumers were successfully associated
400 - if one or more of the parameters is invalid
404 - if the group does not exist
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.
/pulp/api/v2/consumer_groups/<consumer_group_id>/actions/unassociate/
criteria (object) - criteria used to specify the consumers to associate
200 - the consumers were successfully unassociated
400 - if one or more of the parameters is invalid
404 - if the group does not exist
Sample Request:
{
"criteria": {
"filters": {
"id": {
"$in": [
"lab1",
"lab2"
]
}
}
}
}
Sample 200 Response Body:
["lab0"]