Repository Binding¶
Bind a Consumer Group to a Repository¶
Bind a consumer group to a repository’s distributor for the purpose of consuming published content. Binding each consumer in the group is performed through the following steps:
- Create each binding on server.
- Send a request to each consumer to create the binding. A separate task is created for each unique combination of consumer, repository, and distributor.
The distributor may support configuration options that it may use for that particular binding. These options are used when generating the payload that is sent to consumers so they may access the repository. See the individual distributor’s documentation for more information on the format.
/pulp/api/v2/consumer_groups/<group_id>/bindings/
- repo_id (string) - unique identifier for the repository
- distributor_id (string) - identifier for the distributor
- options (object) - (optional) options passed to the handler on each consumer
- notify_agent (boolean) - (optional) indicates if the consumer should be sent a message about the new binding; defaults to true if unspecified
- binding_config (object) - (optional) options to be used by the distributor for this binding
- 202 - if the bind request was accepted
- 400 - if one or more of the parameters is invalid
- 404 - if the consumer group does not exist
Sample Request:
{
"repo_id": "test-repo",
"distributor_id": "dist-1"
}
Tags:
Each task created to add the binding to a consumer
will be created with the following tags: "pulp:repository:<repo_id>",
"pulp:consumer:<consumer_id>"
"pulp:repository_distributor:<distributor-id>"
"pulp:action:bind"
Unbind a Consumer Group¶
Remove a binding between each consumer in a consumer group and a repository’s distributor.
Unbinding each consumer in the group is performed through the following steps:
- Mark each binding as deleted on the server.
- Send a request to each consumer to remove the binding.
- Once each consumer has confirmed that the binding has been removed, it is permanently deleted on the server.
The steps for a forced unbind are as follows:
- Each binding is deleted on the server.
- Send a request to each consumer to remove the binding. The result of each consumer request discarded.
In either case step 2 results in a separate task created for each unique combination of consumer, repository, and distributor.
/pulp/api/v2/consumer_groups/<group_id>/bindings/<repo_id>/<distributor_id>
- force (boolean) - (optional) delete the binding immediately and discontinue tracking consumer actions
- options (object) - (optional) options passed to the handler on each consumer
- 202 - the unbind request was accepted
- 400 - if one or more of the parameters is invalid
- 404 - if the consumer group, repository, or distributor does not exist
Tags:
Each task created to remove the binding from a consumer
will be created with the following tags: "pulp:repository:<repo_id>",
"pulp:consumer:<consumer_id>"
"pulp:repository_distributor:<distributor-id>"
"pulp:action:unbind"