API endpoint that allows querying compose-variant-arch relevant to location.

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/compose-tree-locations/

Query params:

  • arch (string)
  • compose (string)
  • location (string)
  • scheme (string)
  • variant (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

{
    "arch": "Arch.name", 
    "compose": "Compose.compose_id", 
    "location": "short", 
    "scheme": "name", 
    "synced_content": [
        "ContentCategory.name"
    ], 
    "url": "string", 
    "variant": "Variant.variant_uid"
}

Method: GET

URL: /rest_api/v1/compose-tree-locations/{compose_id}/{variant_uid}/{arch}/{location}/{scheme}/

Response:

{
    "arch": "Arch.name", 
    "compose": "Compose.compose_id", 
    "location": "short", 
    "scheme": "name", 
    "synced_content": [
        "ContentCategory.name"
    ], 
    "url": "string", 
    "variant": "Variant.variant_uid"
}

Method: POST

URL: /rest_api/v1/compose-tree-locations/

Data:

{
    "arch": "Arch.name", 
    "compose": "Compose.compose_id", 
    "location": "short", 
    "scheme": "name", 
    "synced_content": [
        "ContentCategory.name"
    ], 
    "url": "string", 
    "variant": "Variant.variant_uid"
}

All fields are required. The required architectures must already be present in PDC. compose/variant/arch combo must exist already for CREATE.

Response: Same as input data.

NOTE: If synced_content is omitted, all content types are filled in.

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.

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.

Only some composetreelocation fields can be modified by this call. They are scheme, synced_content and url. Trying to change anything else will result in 400 BAD REQUEST response.

Method: PATCH

URL: /rest_api/v1/compose-tree-locations/{compose_id}/{variant_uid}/{arch}/{location}/{scheme}/

Data:

{
    "scheme": string,
    "synced_content": [string],
    "url": string
}

If the same content category is specified in synced_content multiple times, it will be saved only once.

Response: same as for retrieve

It is possible to perform bulk partial update on composetreelocation with PATCH method. The input must be a JSON object with composetreelocation identifiers as keys. Values for these keys should be in the same format as when updating a single composetreelocation.

Browsable GET

GET /rest_api/v1/compose-tree-locations/
HTTP 200 OK
Allow: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

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