API endpoint that allows product versions to be viewed or edited.

Product versions always refer to a product by means of a human readable short name. Similarly releases are referenced by release_id. This applies to both requests and responses.

Documents & examples

Method: GET

URL: /rest_api/v1/product-versions/

Query params:

  • active (bool)
  • allowed_push_targets (string)
  • name (string)
  • product_version_id (string)
  • short (string)
  • 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": ...}}).

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

{
    "active (read-only)": "boolean", 
    "allowed_push_targets (optional, default=[])": [
        "name"
    ], 
    "name": "string", 
    "product": "Product.short", 
    "product_version_id (read-only)": "string", 
    "releases (read-only)": "[release_id]", 
    "short": "string", 
    "version": "string"
}

The list of releases for each product version is ordered by short and version.

Method: GET

URL: /rest_api/v1/product-versions/{product_version_id}/

Response:

{
    "active (read-only)": "boolean", 
    "allowed_push_targets (optional, default=[])": [
        "name"
    ], 
    "name": "string", 
    "product": "Product.short", 
    "product_version_id (read-only)": "string", 
    "releases (read-only)": "[release_id]", 
    "short": "string", 
    "version": "string"
}

The list of releases is ordered by short and version.

Method: POST

URL: /rest_api/v1/product-versions/

Data:

{
    "allowed_push_targets (optional, default=[])": [
        "name"
    ], 
    "name": "string", 
    "product": "Product.short", 
    "short": "string", 
    "version": "string"
}

If short is not specified, the short name of associated product will be used.

Field allowed_push_targets must be subset of parent product.

Response:

{
    "active (read-only)": "boolean", 
    "allowed_push_targets (optional, default=[])": [
        "name"
    ], 
    "name": "string", 
    "product": "Product.short", 
    "product_version_id (read-only)": "string", 
    "releases (read-only)": "[release_id]", 
    "short": "string", 
    "version": "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/product-versions/{product_version_id}/

Data:

{
    "allowed_push_targets (optional, default=[])": [
        "name"
    ], 
    "name": "string", 
    "product": "Product.short", 
    "short": "string", 
    "version": "string"
}

Please note that if you change the short or version field, the product_version_id will be modified accordingly, and the URL of the object will be changed. All changes are local to the updated model and are not propagated to associated releases.

Field allowed_push_targets must be subset of parent product.

Changing allowed_push_targets field also affects this field in child releases and variants.

Response:

{
    "active (read-only)": "boolean", 
    "allowed_push_targets (optional, default=[])": [
        "name"
    ], 
    "name": "string", 
    "product": "Product.short", 
    "product_version_id (read-only)": "string", 
    "releases (read-only)": "[release_id]", 
    "short": "string", 
    "version": "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/product-versions/
HTTP 200 OK
Allow: GET, POST, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 9,
    "next": null,
    "previous": null,
    "results": [
        {
            "name": "epel 6",
            "short": "epel",
            "version": "6",
            "active": true,
            "product_version_id": "epel-6",
            "product": "epel",
            "releases": [
                "epel-6-updates"
            ],
            "allowed_push_targets": []
        },
        {
            "name": "epel 7",
            "short": "epel",
            "version": "7",
            "active": true,
            "product_version_id": "epel-7",
            "product": "epel",
            "releases": [
                "epel-7-updates",
                "fedora-epel7-updates"
            ],
            "allowed_push_targets": []
        },
        {
            "name": "fedora 24",
            "short": "fedora",
            "version": "24",
            "active": false,
            "product_version_id": "fedora-24",
            "product": "fedora",
            "releases": [
                "fedora-24",
                "fedora-24-updates",
                "fedora-atomic-24",
                "fedora-cloud-24"
            ],
            "allowed_push_targets": []
        },
        {
            "name": "fedora 25",
            "short": "fedora",
            "version": "25",
            "active": false,
            "product_version_id": "fedora-25",
            "product": "fedora",
            "releases": [
                "fedora-25",
                "fedora-25-updates",
                "fedora-atomic-25",
                "fedora-cloud-25",
                "fedora-docker-25"
            ],
            "allowed_push_targets": []
        },
        {
            "name": "fedora 26",
            "short": "fedora",
            "version": "26",
            "active": false,
            "product_version_id": "fedora-26",
            "product": "fedora",
            "releases": [
                "fedora-26",
                "fedora-26-updates",
                "fedora-atomic-26",
                "fedora-docker-26",
                "fedora-modular-26"
            ],
            "allowed_push_targets": []
        },
        {
            "name": "fedora 27",
            "short": "fedora",
            "version": "27",
            "active": true,
            "product_version_id": "fedora-27",
            "product": "fedora",
            "releases": [
                "fedora-27",
                "fedora-27-updates",
                "fedora-modular-27"
            ],
            "allowed_push_targets": []
        },
        {
            "name": "fedora 28",
            "short": "fedora",
            "version": "28",
            "active": true,
            "product_version_id": "fedora-28",
            "product": "fedora",
            "releases": [
                "fedora-28"
            ],
            "allowed_push_targets": []
        },
        {
            "name": "fedora 29",
            "short": "fedora",
            "version": "29",
            "active": true,
            "product_version_id": "fedora-29",
            "product": "fedora",
            "releases": [
                "fedora-29"
            ],
            "allowed_push_targets": []
        },
        {
            "name": "fedora rawhide",
            "short": "fedora",
            "version": "rawhide",
            "active": true,
            "product_version_id": "fedora-rawhide",
            "product": "fedora",
            "releases": [
                "fedora-Rawhide",
                "fedora-modular-Rawhide"
            ],
            "allowed_push_targets": []
        }
    ]
}