Product List
API endpoint that allows products to be viewed or edited.
Each product can have multiple version. Their identifiers are provided in
the form of product_version_id
(both in requests and responses).
Documents & examples
Method: GET
Query params:
active
(bool)allowed_push_targets
(string)name
(string)short
(string)ordering
(string) Comma separated list of fields for ordering results.- To sort by a field in descending order, prefix its name with minus (e.g.
-name
). - Use double underscores for nested field names (e.g.
parent__child
for{"parent": {"child": ...}}
).
- To sort by a field in descending order, prefix its name with minus (e.g.
Following filters can be used to show only specific fields. This can make
response time faster. Format is list or single value
(JSON: {"fields": ["a","b"]}
or {"fields": "a"}
, in URL: ?fields=a&fields=b
).
fields
(list | string) Fields to display (other fields will be hidden).exclude_fields
: (list | string) Fields NOT to display (overrulesfields
).
Response: a paged list of following objects
{
"active (read-only)": "boolean",
"allowed_push_targets (optional, default=[])": [
"name"
],
"name": "string",
"product_versions (read-only)": [
"product_version_id"
],
"short": "string"
}
Method: GET
URL: /rest_api/v1/products/{short}/
Response:
{
"active (read-only)": "boolean",
"allowed_push_targets (optional, default=[])": [
"name"
],
"name": "string",
"product_versions (read-only)": [
"product_version_id"
],
"short": "string"
}
Method: POST
Data:
{
"allowed_push_targets (optional, default=[])": [
"name"
],
"name": "string",
"short": "string"
}
Response:
{
"active (read-only)": "boolean",
"allowed_push_targets (optional, default=[])": [
"name"
],
"name": "string",
"product_versions (read-only)": [
"product_version_id"
],
"short": "string"
}
It is possible to create this resource in bulk. To do so, use the same procedure as when creating a single instance, only the request body should contain a list of JSON objects. The response you get back will also contain a list of values which you would obtain by submitting the request data separately.
Method: PUT, PATCH
URL: /rest_api/v1/products/{short}/
Data:
{
"allowed_push_targets (optional, default=[])": [
"name"
],
"name": "string",
"short": "string"
}
Please note that if you update the short
field, the URL of this
product will change. The change of short name is not propagated to
product versions nor releases.
Changing allowed_push_targets
field also affects this field in
child product versions, releases and variants.
Response:
{
"active (read-only)": "boolean",
"allowed_push_targets (optional, default=[])": [
"name"
],
"name": "string",
"product_versions (read-only)": [
"product_version_id"
],
"short": "string"
}
It is possible to update multiple objects in one request. Use the PUT
or
PATCH
method with the same url as for listing/creating objects. The
request body should contain an object, where keys are identifiers of
objects to be modified and their values use the same format as normal
update.
Browsable GET
GET /rest_api/v1/products/
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"name": "EPEL",
"short": "epel",
"active": true,
"product_versions": [
"epel-6",
"epel-7",
"epel-8",
"epel-9"
],
"allowed_push_targets": []
},
{
"name": "Fedora",
"short": "fedora",
"active": true,
"product_versions": [
"fedora-24",
"fedora-25",
"fedora-26",
"fedora-27",
"fedora-28",
"fedora-29",
"fedora-30",
"fedora-31",
"fedora-32",
"fedora-33",
"fedora-34",
"fedora-35",
"fedora-36",
"fedora-37",
"fedora-38",
"fedora-39",
"fedora-f37",
"fedora-rawhide"
],
"allowed_push_targets": []
}
]
}