API endpoint that allows release component relationship to be viewed or edited.

Documents & examples

Method: GET

URL: /rest_api/v1/release-component-relationships/

Query params:

  • from_component_name (string)
  • from_component_release (string)
  • to_component_name (string)
  • to_component_release (string)
  • 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).

Response: a paged list of following objects

{
    "from_component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "id (read-only)": "int", 
    "to_component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "type": "ReleaseComponentRelationshipType.name"
}

Method: GET

URL: /rest_api/v1/release-component-relationships/{instance_pk}/

Response:

{
    "from_component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "id (read-only)": "int", 
    "to_component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "type": "ReleaseComponentRelationshipType.name"
}

Method: POST

URL: /rest_api/v1/release-component-relationships/

Data:

{
    "from_component":       dict,         # required
    "type":                 string,       # required
    "to_component":         dict,         # required
}

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

Note:

  • from_component: {"id": 1} or {"release": "release-1.0", "name": "python27"}
  • type: relationship type
  • to_component: {"id": 2} or {"release": "release-2.0", "name": "python27"}

Response:

{
    "from_component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "id (read-only)": "int", 
    "to_component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "type": "ReleaseComponentRelationshipType.name"
}

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/release-component-relationships/{instance_pk}/

Data:

{
    "from_component":       dict,         # required
    "type":                 string,       # required
    "to_component":         dict,         # required
}

Note:

  • from_component: {"id": 1} or {"release": "release-1.0", "name": "python27"}
  • to_component: {"id": 2} or {"release": "release-2.0", "name": "python27"}

Response:

{
    "from_component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "id (read-only)": "int", 
    "to_component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "type": "ReleaseComponentRelationshipType.name"
}

Method: DELETE

URL: /rest_api/v1/release-component-relationships/{instance_pk}/

Response:

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

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-component-relationships/?page=650
HTTP 200 OK
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "count": 12984,
    "next": null,
    "previous": "https://pdc.fedoraproject.org/rest_api/v1/release-component-relationships/?page=649",
    "results": [
        {
            "id": 21531736,
            "type": "ContainerIncludesRPM",
            "from_component": {
                "release": "fedora-27-updates",
                "id": 267536,
                "name": "varnish"
            },
            "to_component": {
                "release": "fedora-27-updates",
                "id": 267308,
                "name": "perl-interpreter"
            }
        },
        {
            "id": 21531737,
            "type": "ContainerIncludesRPM",
            "from_component": {
                "release": "fedora-27-updates",
                "id": 267536,
                "name": "varnish"
            },
            "to_component": {
                "release": "fedora-27-updates",
                "id": 267408,
                "name": "cmake-rpm-macros"
            }
        },
        {
            "id": 21531738,
            "type": "ContainerIncludesRPM",
            "from_component": {
                "release": "fedora-27-updates",
                "id": 267536,
                "name": "varnish"
            },
            "to_component": {
                "release": "fedora-27-updates",
                "id": 267540,
                "name": "logrotate"
            }
        },
        {
            "id": 21531739,
            "type": "ContainerIncludesRPM",
            "from_component": {
                "release": "fedora-27-updates",
                "id": 267536,
                "name": "varnish"
            },
            "to_component": {
                "release": "fedora-27-updates",
                "id": 267541,
                "name": "ipcalc"
            }
        }
    ]
}