Overview

This page shows the usage of the Release Component API, please see the following for more details.

Test tools

You can use curl in terminal, with -X method (GET|POST|PUT|DELETE), -d data (a json string). or GUI plugins for browsers, such as RESTClient, RESTConsole.

Documents & examples

Method: GET

URL: /rest_api/v1/release-components/

Query Params:

  • active (bool)
  • brew_package (string)
  • bugzilla_component (string)
  • dist_git_branch (string)
  • global_component (string)
  • include_inactive_release
  • name (string)
  • release (string)
  • srpm_name (string | null)
  • type (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).

Components for inactive releases are not shown by default. You can change this with include_inactive_release set to any non-empty value.

Response:

# paged lists
{
    "count": int,
    "next": url,
    "previous": url,
    "results": [
        {
            "id": int,
            "release": {
                "release_id": string,
                "active": bool
            },
            "global_component": string,
            "bugzilla_component": {
                "id": int,
                "name": string,
                "parent_component": string,
                "subcomponents": [
                    ......
                ]
            },
            "brew_package": string,
            "name": string,
            "dist_git_branch": <string|null>,
            "dist_git_web_url": string,
            "active": bool,
            "srpm": {
                "name": string
            } OR null,
            "type": <string|null>
        }
        ...
}

Method: GET

URL: /rest_api/v1/release-components/{instance_pk}/

Response:

{
    "id": int,
    "release": {
        "release_id": string,
        "active": bool
    },
    "global_component": string,
    "bugzilla_component": {
        "id": int,
        "name": string,
        "parent_component": string,
        "subcomponents": [
            ......
        ]
    },
    "brew_package": string,
    "name": string,
    "dist_git_branch": <string|null>,
    "dist_git_web_url": string,
    "active": true,
    "srpm": {
        "name": string
    } OR null,
    "type": <string|null>
}

Method: POST

URL: /rest_api/v1/release-components/

Data:

{
    'name':                          string,         # required
    'release':                       string,         # required
    'global_component':              string,         # required
    'dist_git_branch':               string,         # optional
    'bugzilla_component':            string,         # optional
    'brew_package':                  string,         # optional
    'active':                        bool,           # optional
    'srpm':
        {
            "name":                  string,
        } OR null,                                   # optional
    'type':                          string,         # optional
}

type: /rest_api/v1/release-component-types/

Response:

{
    "id": int,
    "release": {
        "release_id": string,
        "active": bool
    },
    "global_component": string,
    "brew_package": string,
    "name": string,
    "dist_git_branch": <string|null>,
    "dist_git_web_url": string,
    "active": true,
    "bugzilla_component": {
        "id": int,
        "name": string,
        "parent_component": null,
        "subcomponents": [
            ......
        ]
    },
    "srpm": {
        "name": string
    } OR null,
    "type": <string|null>
}

NOTE:

bugzilla_component can be in format parent_component/bugzilla_component or bugzilla_component, for example, kernel/filesystem or kernel, single bugzilla_component means parent_component is null.

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:

name: new release component's name, REQUIRED

dist_git_branch: new release component dist git branch, OPTIONAL

bugzilla_component: bugzilla component name, OPTIONAL

brew_package: brew package name, OPTIONAL

"active": status of release component, defalut=true,OPTIONAL

"srpm": { "name": srpm name of release component } OR null, OPTIONAL

"type": release component type, OPTIONAL

"global_component": release component's global component, OPTIONAL

PATCH:

name: new release component's name, OPTIONAL

dist_git_branch: new release component dist git branch, OPTIONAL

bugzilla_component: bugzilla component name, OPTIONAL

brew_package: brew package name, OPTIONAL

"active": status of release component, OPTIONAL

"srpm": { "name": srpm name of release component } OR null, OPTIONAL

"type": release component type, OPTIONAL

"global_component": release component's global component, OPTIONAL

URL: /rest_api/v1/release-components/{instance_pk}/

Response:

{
    "id": int,
    "release": {
        "release_id": string,
        "active": bool
    },
    "global_component": string,
    "bugzilla_component": {
        ......
    },
    "brew_package": string,
    "name": string,
    "dist_git_branch": <string|null>,
    "dist_git_web_url": string,
    "active": true,
    "srpm": {
        "name": string
    } OR null
}

NOTE:

bugzilla_component can be in format parent_component/bugzilla_component or bugzilla_component, for example, kernel/filesystem or kernel, single bugzilla_component means parent_component is null. {"bugzilla_component": null or "bugzilla_component": ""} is to set bugzilla_component to null, while bugzilla_component not given means not update bugzilla_component.

Method: DELETE

URL: /rest_api/v1/release-components/{instance_pk}/

Response:

STATUS: 204 NO CONTENT

Example:

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

{
    "count": 1207,
    "next": "https://pdc.fedoraproject.org/rest_api/v1/release-components/?page=2",
    "previous": null,
    "results": [
        {
            "id": 264746,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "cockpit",
            "name": "cockpit",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/cockpit.git?h=master",
            "active": true,
            "type": "container",
            "srpm": null
        },
        {
            "id": 264747,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "nss-pem",
            "name": "nss-pem",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/nss-pem.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264749,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "perl",
            "name": "perl",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/perl.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264751,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "lz4",
            "name": "lz4",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/lz4.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264753,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "perl-parent",
            "name": "perl-parent",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/perl-parent.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264755,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "gc",
            "name": "gc",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/gc.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264757,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "perl-Unicode-Normalize",
            "name": "perl-Unicode-Normalize",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/perl-Unicode-Normalize.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264758,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "popt",
            "name": "popt",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/popt.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264759,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "gdbm",
            "name": "gdbm",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/gdbm.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264762,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "systemd",
            "name": "systemd",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/systemd.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264763,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "libpwquality",
            "name": "libpwquality",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/libpwquality.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264764,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "libpcap",
            "name": "libpcap",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/libpcap.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264765,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "coreutils",
            "name": "coreutils",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/coreutils.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264768,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "crypto-policies",
            "name": "crypto-policies",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/crypto-policies.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264770,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "perl-Carp",
            "name": "perl-Carp",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/perl-Carp.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264771,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "python3",
            "name": "python3",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/python3.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264773,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "gmp",
            "name": "gmp",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/gmp.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264775,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "perl-PathTools",
            "name": "perl-PathTools",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/perl-PathTools.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264779,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "libidn",
            "name": "libidn",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/libidn.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        },
        {
            "id": 264780,
            "release": {
                "active": true,
                "release_id": "fedora-27-updates"
            },
            "bugzilla_component": null,
            "brew_package": null,
            "global_component": "perl-Socket",
            "name": "perl-Socket",
            "dist_git_branch": "master",
            "dist_git_web_url": "https://src.fedoraproject.org/cgit/rpms/perl-Socket.git?h=master",
            "active": true,
            "type": "rpm",
            "srpm": null
        }
    ]
}