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:

  1. Create each binding on server.

  2. 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.

Method: POST
Path: /pulp/api/v2/consumer_groups/<group_id>/bindings/
Permission: create
Request Body Contents:
  • 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

Response Codes:
  • 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

Return: a Call Report

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:

  1. Mark each binding as deleted on the server.

  2. Send a request to each consumer to remove the binding.

  3. 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:

  1. Each binding is deleted on the server.

  2. 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.

Method: DELETE
Path: /pulp/api/v2/consumer_groups/<group_id>/bindings/<repo_id>/<distributor_id>
Permission: delete
Query Parameters: The consumer ID, repository ID and distributor ID are included in the URL itself.
  • force (boolean) - (optional) delete the binding immediately and discontinue tracking consumer actions

  • options (object) - (optional) options passed to the handler on each consumer

Response Codes:
  • 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

Return: a Call Report

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"