Retrieval

Retrieve a Single Repository

Retrieves information on a single Pulp repository. The returned data includes general repository metadata, metadata describing any importers and distributors associated with it, and a count of how many content units have been stored locally for the repository.

Method: GET
Path: /pulp/api/v2/repositories/<repo_id>/
Permission: read
Query Parameters:
  • details (boolean) - (optional) shortcut for including distributors, importers, and content unit counts
  • importers (boolean) - (optional) include the “importers” attribute on each repository
  • distributors (boolean) - (optional) include the “distributors” attribute on each repository
Response Codes:
  • 200 - if the repository exists
  • 404 - if no repository exists with the given ID
Return: database representation of the matching repository

Sample 200 Response Body:

{
 "display_name": "Harness Repository: harness_repo_1",
 "description": null,
 "distributors": [
   {
     "scratchpad": 1,
     "_ns": "repo_distributors",
     "last_publish": "2012-01-25T15:26:32Z",
     "auto_publish": false,
     "distributor_type_id": "harness_distributor",
     "repo_id": "harness_repo_1",
     "publish_in_progress": false,
     "_id": "addf9261-345e-4ce3-ad1e-436ba005287f",
     "config": {
       "publish_dir": "/tmp/harness-publish",
       "write_files": "true"
     },
     "id": "dist_1"
   }
 ],
 "notes": {},
 "scratchpad": {},
 "content_unit_counts": {},
 "last_unit_added": "2012-01-25T15:26:32Z",
 "last_unit_removed": "2012-01-25T15:26:32Z",
 "importers": [
   {
     "scratchpad": 1,
     "_ns": "repo_importers",
     "importer_type_id": "harness_importer",
     "last_sync": "2012-01-25T15:26:32Z",
     "repo_id": "harness_repo_1",
     "sync_in_progress": false,
     "_id": "bbe81308-ef7c-4c0c-b684-385fd627d99e",
     "config": {
       "num_units": "5",
       "write_files": "true"
     },
     "id": "harness_importer"
   }
 ],
 "id": "harness_repo_1",
 "total_repository_units": 5,
 "locally_stored_units": 3
}

Retrieve All Repositories

Returns information on all repositories in the Pulp server. It is worth noting that this call will never return a 404; an empty array is returned in the case where there are no repositories.

Method: GET
Path: /pulp/api/v2/repositories/
Permission: read
Query Parameters:
  • details (boolean) - (optional) shortcut for including both distributors and importers
  • importers (boolean) - (optional) include the “importers” attribute on each repository
  • distributors (boolean) - (optional) include the “distributors” attribute on each repository
Response Codes:
  • 200 - containing the array of repositories
Return: the same format as retrieving a single repository, except the base of the return value is an array of them

Sample 200 Response Body:

[
 {
   "display_name": "Harness Repository: harness_repo_1",
   "description": null,
   "last_unit_added": "2012-01-25T15:26:32Z",
   "last_unit_removed": null,
   "distributors": [
     {
       "scratchpad": 1,
       "_ns": "repo_distributors",
       "last_publish": "2012-01-25T15:26:32Z",
       "auto_publish": false,
       "distributor_type_id": "harness_distributor",
       "repo_id": "harness_repo_1",
       "publish_in_progress": false,
       "_id": "addf9261-345e-4ce3-ad1e-436ba005287f",
       "config": {
         "publish_dir": "/tmp/harness-publish",
         "write_files": "true"
       },
       "id": "dist_1"
     }
   ],
   "notes": {},
   "scratchpad": {},
   "content_unit_counts": {},
   "importers": [
     {
       "scratchpad": 1,
       "_ns": "repo_importers",
       "importer_type_id": "harness_importer",
       "last_sync": "2012-01-25T15:26:32Z",
       "repo_id": "harness_repo_1",
       "sync_in_progress": false,
       "_id": "bbe81308-ef7c-4c0c-b684-385fd627d99e",
       "config": {
         "num_units": "5",
         "write_files": "true"
       },
       "id": "harness_importer"
     }
   ],
   "id": "harness_repo_1"
 }
]

Advanced Search for Repositories

Please see Search API for more details on how to perform these searches.

Returns information on repositories in the Pulp server that match your search parameters. It is worth noting that this call will never return a 404; an empty array is returned in the case where there are no repositories.

Method: POST
Path: /pulp/api/v2/repositories/search/
Permission: read
Request Body Contents:
  • details (boolean) - (optional) shortcut to include “importers” and “distributors”
  • importers (boolean) - (optional) include the “importers” attribute on each repository
  • distributors (boolean) - (optional) include the “distributors” attribute on each repository
Response Codes:
  • 200 - containing the array of repositories
Return: the same format as retrieving a single repository, except the base of the return value is an array of them

Sample 200 Response Body:

[
 {
   "display_name": "Harness Repository: harness_repo_1",
   "description": null,
   "distributors": [
     {
       "scratchpad": 1,
       "_ns": "repo_distributors",
       "last_publish": "2012-01-25T15:26:32Z",
       "auto_publish": false,
       "distributor_type_id": "harness_distributor",
       "repo_id": "harness_repo_1",
       "publish_in_progress": false,
       "_id": "addf9261-345e-4ce3-ad1e-436ba005287f",
       "config": {
         "publish_dir": "/tmp/harness-publish",
         "write_files": "true"
       },
       "id": "dist_1"
     }
   ],
   "notes": {},
   "scratchpad": {},
   "content_unit_counts": {},
   "last_unit_added": null,
   "last_unit_removed": null,
   "importers": [
     {
       "scratchpad": 1,
       "_ns": "repo_importers",
       "importer_type_id": "harness_importer",
       "last_sync": "2012-01-25T15:26:32Z",
       "repo_id": "harness_repo_1",
       "sync_in_progress": false,
       "_id": "bbe81308-ef7c-4c0c-b684-385fd627d99e",
       "config": {
         "num_units": "5",
         "write_files": "true"
       },
       "id": "harness_importer"
     }
   ],
   "id": "harness_repo_1"
 }
]

Returns information on repositories in the Pulp server that match your search parameters. It is worth noting that this call will never return a 404; an empty array is returned in the case where there are no repositories.

This method is slightly more limiting than the POST alternative, because some filter expressions may not be serializable as query parameters.

Method: GET
Path: /pulp/api/v2/repositories/search/
Permission: read
Query Parameters: query params should match the attributes of a Criteria object as defined in Search Criteria. The exception is the ‘fields’ parameter, which should be specified in singular form as follows: For example: /v2/repositories/search/?field=id&field=display_name&limit=20’
  • details (boolean) - (optional) shortcut for including both distributors and importers
  • importers (boolean) - (optional) include the “importers” attribute on each repository
  • distributors (boolean) - (optional) include the “distributors” attribute on each repository
Response Codes:
  • 200 - containing the array of repositories
Return: the same format as retrieving a single repository, except the base of the return value is an array of them

Sample 200 Response Body:

[
 {
   "display_name": "Harness Repository: harness_repo_1",
   "description": null,
   "distributors": [
     {
       "scratchpad": 1,
       "_ns": "repo_distributors",
       "last_publish": "2012-01-25T15:26:32Z",
       "auto_publish": false,
       "distributor_type_id": "harness_distributor",
       "repo_id": "harness_repo_1",
       "publish_in_progress": false,
       "_id": "addf9261-345e-4ce3-ad1e-436ba005287f",
       "config": {
         "publish_dir": "/tmp/harness-publish",
         "write_files": "true"
       },
       "id": "dist_1"
     }
   ],
   "notes": {},
   "scratchpad": {},
   "content_unit_counts": {},
   "last_unit_added": null,
   "last_unit_removed": null,
   "importers": [
     {
       "scratchpad": 1,
       "_ns": "repo_importers",
       "importer_type_id": "harness_importer",
       "last_sync": "2012-01-25T15:26:32Z",
       "repo_id": "harness_repo_1",
       "sync_in_progress": false,
       "_id": "bbe81308-ef7c-4c0c-b684-385fd627d99e",
       "config": {
         "num_units": "5",
         "write_files": "true"
       },
       "id": "harness_importer"
     }
   ],
   "id": "harness_repo_1"
 }
]

Retrieve Importers Associated with a Repository

Retrieves the importer (if any) associated with a repository. The array will either be empty (no importer configured) or contain a single entry.

Method: GET
Path: /pulp/api/v2/repositories/<repo_id>/importers/
Permission: read
Query Parameters: None
Response Codes:
  • 200 - containing an array of importers
  • 404 - if there is no repository with the given ID; this will not occur if the repository exists but has no associated importers
Return: database representation of the repository’s importer or an empty list

Sample 200 Response Body:

[
   {
       "_href": "/pulp/api/v2/repositories/zoo/importers/yum_importer/",
       "_id": {
           "$oid": "563c82fa45ef48043f026c32"
       },
       "_ns": "repo_importers",
       "config": {
           "feed": "http://example.com/repos/zoo/"
       },
       "id": "yum_importer",
       "importer_type_id": "yum_importer",
       "last_sync": "2015-11-06T10:38:23Z",
       "repo_id": "zoo",
       "scratchpad": {
           "repomd_revision": 1331832478
       }
   }
]

Retrieve an Importer Associated with a Repository

Retrieves the given importer (if any) associated with a repository.

Method: GET
Path: /pulp/api/v2/repositories/<repo_id>/importers/<importer_id>/
Permission: read
Query Parameters: None
Response Codes:
  • 200 - containing the details of the importer
  • 404 - if there is either no repository or importer with a matching ID.
Return: database representation of the repository’s importer

Sample 200 Response Body:

{
   "_href": "/pulp/api/v2/repositories/zoo/importers/yum_importer/",
   "_id": {
       "$oid": "563c82fa45ef48043f026c32"
   },
   "_ns": "repo_importers",
   "config": {
       "feed": "http://example.com/repos/zoo/"
   },
   "id": "yum_importer",
   "importer_type_id": "yum_importer",
   "last_sync": "2015-11-06T10:38:23Z",
   "repo_id": "zoo",
   "scratchpad": {
       "repomd_revision": 1331832478
   }
}

Retrieve Distributors Associated with a Repository

Retrieves all distributors associated with a repository. If the repository has no associated distributors, an empty array is returned.

Method: GET
Path: /pulp/api/v2/repositories/<repo_id>/distributors/
Permission: read
Query Parameters: None
Response Codes:
  • 200 - containing an array of distributors
  • 404 - if there is no repository with the given ID; this will not occur if the repository exists but has no associated distributors
Return: database representations of all distributors on the repository

Sample 200 Response Body:

[
 {
   "scratchpad": 1,
   "_ns": "repo_distributors",
   "last_publish": "2012-01-25T15:26:32Z",
   "auto_publish": false,
   "distributor_type_id": "harness_distributor",
   "repo_id": "harness_repo_1",
   "publish_in_progress": false,
   "_id": "addf9261-345e-4ce3-ad1e-436ba005287f",
   "config": {
     "publish_dir": "/tmp/harness-publish",
     "write_files": "true"
   },
   "id": "dist_1"
 }
]

Retrieve a Distributor Associated with a Repository

Retrieves a single distributors associated with a repository.

Method: GET
Path: /pulp/api/v2/repositories/<repo_id>/distributors/<distributor_id>/
Permission: read
Query Parameters: None
Response Codes:
  • 200 - containing the details of a distributors
  • 404 - if there is either no repository or distributor with a matching ID.
Return: database representation of the distributor

Sample 200 Response Body:

{
  "scratchpad": 1,
  "_ns": "repo_distributors",
  "last_publish": "2012-01-25T15:26:32Z",
  "auto_publish": false,
  "distributor_type_id": "harness_distributor",
  "repo_id": "harness_repo_1",
  "publish_in_progress": false,
  "_id": {"$oid": "addf9261-345e-4ce3-ad1e-436ba005287f"},
  "config": {
    "publish_dir": "/tmp/harness-publish",
    "write_files": "true"
  },
  "id": "dist_1"
}

Advanced Search for Distributors

Please see Search API for more details on how to perform these searches.

Returns information on distributors in the Pulp server that match your search parameters. It is worth noting that this call will never return a 404; an empty array is returned in the case where there are no distributors.

Method: POST
Path: /pulp/api/v2/distributors/search/
Permission: read
Request Body Contents:
Response Codes:
  • 200 - containing the array of distributors
Return: a list of distributor objects

Sample 200 Response Body:

[
  {
    "repo_id": "el7",
    "last_publish": "2015-04-28T18:19:01Z",
    "auto_publish": null,
    "scheduled_publishes": [],
    "distributor_type_id": "ostree_web_distributor",
    "scratchpad": null,
    "config": {
      "relative_path": "/opt/content/ostree/el7"
    },
    "id": "ostree_web_distributor_name_cli"
  },
  {
    "repo_id": "el6",
    "last_publish": "2015-5-28T18:18:01Z",
    "auto_publish": null,
    "scheduled_publishes": [],
    "distributor_type_id": "ostree_web_distributor",
    "scratchpad": null,
    "config": {
      "relative_path": "/opt/content/ostree/el6"
    },
    "id": "ostree_web_distributor_name_cli"
  }
]