Warning: This is an experimental API

This API endpoint is about released files.

Documents & examples

Method: GET

URL: /rest_api/v1/released-files/

Query params:

  • arch (string)
  • file_primary_key (int)
  • obsolete (bool)
  • release_date (string)
  • release_date_after (string)
  • release_date_before (string)
  • release_id (string)
  • released_date (string)
  • released_date_after (string)
  • released_date_before (string)
  • repo (string)
  • repo_name (string)
  • service (string)
  • variant_uid (string)
  • zero_day_release (bool)
  • 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": ...}}).

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 (overrules fields).

Response: a paged list of following objects

Return with build, file, package the build is rpm.srpm_name-rpm.version-rpm.arch, the file is rpm.filename, the package is rpm.srpm_name.

Please visit /rest_api/v1/content-delivery-content-formats/ to get the endpoint's name of file_primary_key

{
    "created_at (read-only)": "datetime", 
    "file_primary_key": "int", 
    "id (read-only)": "int", 
    "obsolete (optional, default=false)": "boolean", 
    "release_date": "date", 
    "released_date (optional, default=null)": "date", 
    "repo": {
        "arch": "string", 
        "content_category": "ContentCategory.name", 
        "content_format": "ContentFormat.name", 
        "id (read-only)": "int", 
        "name": "string", 
        "product_id (optional, default=null, nullable)": "int", 
        "release_id": "string", 
        "repo_family": "RepoFamily.name", 
        "service": "Service.name", 
        "shadow (optional, default=false)": "boolean", 
        "variant_uid": "string"
    }, 
    "updated_at (read-only)": "datetime", 
    "zero_day_release (optional, default=false)": "boolean"
}

Method: GET

URL: /rest_api/v1/released-files/{instance_pk}/

Response:

Return with build, file, package the build is rpm.srpm_name-rpm.version-rpm.arch, the file is rpm.filename, the package is rpm.srpm_name.

{
    "created_at (read-only)": "datetime", 
    "file_primary_key": "int", 
    "id (read-only)": "int", 
    "obsolete (optional, default=false)": "boolean", 
    "release_date": "date", 
    "released_date (optional, default=null)": "date", 
    "repo": {
        "arch": "string", 
        "content_category": "ContentCategory.name", 
        "content_format": "ContentFormat.name", 
        "id (read-only)": "int", 
        "name": "string", 
        "product_id (optional, default=null, nullable)": "int", 
        "release_id": "string", 
        "repo_family": "RepoFamily.name", 
        "service": "Service.name", 
        "shadow (optional, default=false)": "boolean", 
        "variant_uid": "string"
    }, 
    "updated_at (read-only)": "datetime", 
    "zero_day_release (optional, default=false)": "boolean"
}

Method: POST

URL: /rest_api/v1/released-files/

Data:

{
    "file_primary_key": "int", 
    "obsolete (optional, default=false)": "boolean", 
    "release_date": "date", 
    "released_date (optional, default=null)": "date", 
    "repo": {
        "id": "int"
    }, 
    "zero_day_release (optional, default=false)": "boolean"
}

Currently release-files just can insert data with repo.content_format rpm.

Response:

Return with build, file, package the build is rpm.srpm_name-rpm.version-rpm.arch, the file is rpm.filename, the package is rpm.srpm_name.

{
    "created_at (read-only)": "datetime", 
    "file_primary_key": "int", 
    "id (read-only)": "int", 
    "obsolete (optional, default=false)": "boolean", 
    "release_date": "date", 
    "released_date (optional, default=null)": "date", 
    "repo": {
        "arch": "string", 
        "content_category": "ContentCategory.name", 
        "content_format": "ContentFormat.name", 
        "id (read-only)": "int", 
        "name": "string", 
        "product_id (optional, default=null, nullable)": "int", 
        "release_id": "string", 
        "repo_family": "RepoFamily.name", 
        "service": "Service.name", 
        "shadow (optional, default=false)": "boolean", 
        "variant_uid": "string"
    }, 
    "updated_at (read-only)": "datetime", 
    "zero_day_release (optional, default=false)": "boolean"
}

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.

When using the PUT method, if an optional field is not specified in the input, it will be erased.

Method: PUT, PATCH

URL: /rest_api/v1/released-files/{instance_pk}/

Data:

{
    "file_primary_key": "int", 
    "obsolete (optional, default=false)": "boolean", 
    "release_date": "date", 
    "released_date (optional, default=null)": "date", 
    "repo": {
        "id": "int"
    }, 
    "zero_day_release (optional, default=false)": "boolean"
}

Currently pdc just can insert data with repo.content_format rpm.

Response:

Return with build, file, package the build is rpm.srpm_name-rpm.version-rpm.arch, the file is rpm.filename, the package is rpm.srpm_name.

{
    "created_at (read-only)": "datetime", 
    "file_primary_key": "int", 
    "id (read-only)": "int", 
    "obsolete (optional, default=false)": "boolean", 
    "release_date": "date", 
    "released_date (optional, default=null)": "date", 
    "repo": {
        "arch": "string", 
        "content_category": "ContentCategory.name", 
        "content_format": "ContentFormat.name", 
        "id (read-only)": "int", 
        "name": "string", 
        "product_id (optional, default=null, nullable)": "int", 
        "release_id": "string", 
        "repo_family": "RepoFamily.name", 
        "service": "Service.name", 
        "shadow (optional, default=false)": "boolean", 
        "variant_uid": "string"
    }, 
    "updated_at (read-only)": "datetime", 
    "zero_day_release (optional, default=false)": "boolean"
}

Method: DELETE

URL: /rest_api/v1/released-files/{instance_pk}/

Response:

On success, HTTP status code is 204 and the response has no content

Example:

curl -X DELETE -H "Content-Type: application/json" https://pdc.fedoraproject.org/rest_api/v1/released-files/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/released-files/
HTTP 200 OK
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 0,
    "next": null,
    "previous": null,
    "results": []
}