Documents & examples

Method: GET

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

Query params:

  • component (regular expression)
  • contact (string)
  • dist_git_branch (string)
  • email (string)
  • global_component (string)
  • release (string)
  • role (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).

The value of contact filter should either be a username or mailling list name.

Response: a paged list of following objects

{
    "component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "contact": {
        "email": "email address", 
        "id": "int", 
        "username|mail_name": "string"
    }, 
    "id (read-only)": "int", 
    "role": "name"
}

Method: GET

URL: /rest_api/v1/release-component-contacts/{pk}/

Response:

{
    "component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "contact": {
        "email": "email address", 
        "id": "int", 
        "username|mail_name": "string"
    }, 
    "id (read-only)": "int", 
    "role": "name"
}

Connect contact details with a component.

If the contact does not exist, it will be created automatically.

Method: POST

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

Data:

{
    "component": {
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "contact": {
        "email": "email address", 
        "username|mail_name": "string"
    }, 
    "role": "name"
}

The component can be alternatively specified by its id as {"id": "int"}.

Depending on whether username or mail_name is used, a person or mailling list will be linked to the component.

View list of available contact roles.

Response:

{
    "component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "contact": {
        "email": "email address", 
        "id": "int", 
        "username|mail_name": "string"
    }, 
    "id (read-only)": "int", 
    "role": "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.

Change details about a contact linked to component.

Please note that if you change the contact field here, only the single updated relationship between contact and component will be updated. Specifically, no other component will be affected.

If you update with new contact details and such contact does not exist yet, it will be automatically created. The specific type will be chosen based on whether username or mail_name was used.

Method: PUT, PATCH

URL: /rest_api/v1/release-component-contacts/{pk}/

Data:

{
    "component": {
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "contact": {
        "email": "email address", 
        "username|mail_name": "string"
    }, 
    "role": "name"
}

The component can be alternatively specified by its id as {"id": "int"}.

View list of available contact roles.

Response:

{
    "component": {
        "id": "int", 
        "name": "string", 
        "release": "Release.release_id"
    }, 
    "contact": {
        "email": "email address", 
        "id": "int", 
        "username|mail_name": "string"
    }, 
    "id (read-only)": "int", 
    "role": "name"
}

Remove association between component and contact.

Method: DELETE

URL: /rest_api/v1/release-component-contacts/{pk}/

Response: Nothing on success.

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-contacts/
HTTP 200 OK
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Content-Type: application/json
Expires: Mon, 10 Dec 2018 10:36:38 GMT
Last-Modified: Mon, 10 Dec 2018 10:36:38 GMT
Vary: Accept

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