Content Retrieval¶
Advanced Unit Search¶
A Unit Association Criteria can be used to search for units within a repository.
Method: POST
Path:
/pulp/api/v2/repositories/<repo_id>/search/units/
Permission: read
Request Body Contents:
criteria (object) - a UnitAssociationCriteria
Response Codes:
200 - if the search executed
400 - if the criteria is missing or not valid
404 - if the repository is not found
Return: array of objects representing content unit associations
Sample Request:
{
"criteria": {
"fields": {
"unit": [
"name",
"version"
]
},
"type_ids": [
"rpm"
],
"limit": 1
}
}
Sample 200 Response Body:
[
{
"updated": "2013-09-04T22:12:05Z",
"repo_id": "zoo",
"created": "2013-09-04T22:12:05Z",
"_ns": "repo_content_units",
"unit_id": "4a928b95-7c4a-4d23-9df7-ac99978f361e",
"metadata": {
"_id": "4a928b95-7c4a-4d23-9df7-ac99978f361e",
"version": "4.1",
"name": "bear",
"pulp_user_metadata": {}
},
"unit_type_id": "rpm",
"_id": {
"$oid": "522777f5e19a002faebebf79"
},
"id": "522777f5e19a002faebebf79"
}
]