Build Image List
ViewSet for BuildImage.
Documents & examples
Method: GET
URL: /rest_api/v1/build-images/
Query params:
archive_build_nvr
(string)archive_md5
(string)archive_name
(string)archive_size
(string)component_name
(string)image_format
(string)image_id
(string)md5
(string)release_id
(string)rpm_release
(string)rpm_version
(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
).
The value of component_name
should be either SRPM name or release
component name if release component to srpm mapping exists.
Response:
# paged list
{
"count": int,
"next": url,
"previous": url,
"results": [
{
"url": url,
"image_id": string,
"image_format": string,
"md5": string,
"rpms": [
"rpm_nevra", string,
...
],
"archives": [
{
"build_nvr": string,
"name": string,
"size": int,
"md5": string,
}
...
],
"releases": [
"release_id", string
......
]
},
...
]
}
Method: GET
URL: /rest_api/v1/build-images/{instance_pk}/
Response:
{
"url": url,
"image_id": string,
"image_format": string,
"md5": string,
"rpms": [
"rpm_nevra", string,
...
],
"archives": [
{
"build_nvr": string,
"name": string,
"size": int,
"md5": string,
}
...
],
"releases": [
"release_id", string
......
]
}
Method: POST
URL: /rest_api/v1/build-images/
Data:
{
"image_id": string, # required
"image_format": string, # required
"md5": string, # required
"rpms": [
{
"name": string, # required
"epoch": int, # required
"version": string, # required
"release": string, # required
"arch": string, # required
"srpm_name": string, # required
"srpm_nevra": string, # optional, the srpm_nevra field should be empty if and only if arch is "src".
"filename": string # optional
}
...
], # optional
"archives": [
{
"build_nvr": string, # required
"name": string, # required
"size": int, # required
"md5": string, # required
}
...
], # optional
"releases": [
release_id, string # optional
......
] # optional
}
If the RPM filename is omitted, a default value will be constructed based on name, version, release and arch.
Response:
{
"url": url,
"image_id": string,
"image_format": string,
"md5": string,
"rpms": [
"rpm_nevra", string,
...
],
"archives": [
{
"build_nvr": string,
"name": string,
"size": int,
"md5": string,
}
...
],
"releases": [
"release_id", 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: for full fields update
{
"image_id": string,
"image_format": string,
"md5": string,
"rpms": [
{
"name": string,
"epoch": int,
"version": string,
"release": string,
"arch": string,
"srpm_name": string,
"srpm_nevra": string,
}
...
],
"archives": [
{
"build_nvr": string,
"name": string,
"size": int,
"md5": string,
}
...
],
"releases": [
"release_id", string
......
]
}
PATCH: for partial update
# so you can give one or more fields in ["image_id", "image_format",
# "md5", "rpms", "archives"]
# to do the update
NOTE: when updating image_format
, its value must be an existed one, otherwise it will
cause HTTP 400 BAD REQUEST error.
URL: /rest_api/v1/build-images/{instance_pk}/
Response:
{
"url": url,
"image_id": string,
"image_format": string,
"md5": string,
"rpms": [
"rpm_nevra", string,
...
],
"archives": [
{
"build_nvr": string,
"name": string,
"size": int,
"md5": string,
}
...
],
"releases": [
"release_id", string
......
]
}
Method: DELETE
URL: /rest_api/v1/build-images/{instance_pk}/
Response:
STATUS: 204 NO CONTENT
Example:
curl -X DELETE -H "Content-Type: application/json" https://pdc.fedoraproject.org/rest_api/v1/build-images/1/
It is possible to delete multiple items in one request. Use the DELETE
method with the same url as for listing/creating objects. The request body
should contain a list with identifiers for objects to be deleted. The
identifier is usually the last part of the URL for deleting a single
object.
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/build-images/
{
"count": 0,
"next": null,
"previous": null,
"results": []
}