Get All CSL Tasks

v4

Retrieve a list of CSL slicer tasks.

Request

Request syntax:

GET /managed-slicer/slicers/tasks

Response

The response for a successful request contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path to this endpoint.
@typeStringReturns Collection.
itemsList of DictionariesContains a list of your tasks.
total_itemsNumberIndicates the total number of tasks.

items List

The items list describes each task through the following properties:

NameData TypeDescription
@idStringIndicates a relative path that returns this resource.
@typeStringReturns ManagedSlicerTask.
idStringIndicates the task's system-defined ID.
operationStringIndicates the type of operation that was performed. Valid values are: CREATEUPDATEDELETE
stateStringIndicates the task's current state. Learn more.
timestampNumberIndicates the timestamp, in Unix time (seconds), at which the task was initiated.

Sample Request/Response

The code below (Python 3) shows how to retrieve a list of your CSL slicer tasks.

This code imports names from the api_auth module for V4 APIs (see below).

import json
import requests
from api_auth import APICredentials, APIParams

class Tasks:
    def __init__(self):
        self.host = "https://services.uplynk.com"

    def run(self):
        """
        Get all CSL slicer tasks.
        """
        self._get_all_csl_slicer_tasks()

    def _get_all_csl_slicer_tasks(self):
        url = "{}{}".format(self.host, "/api/v4/managed-slicer/slicers/tasks")

        response = requests.get(
            url, params=APIParams(APICredentials()).get_params({})
        )

        print(response.json())

Tasks().run()

Response:

{
	"@id": "/api/v4/managed-slicer/slicers/tasks",
	"@type": "Collection",
	"items": [{
			"@id": "/api/v4/managed-slicer/slicers/tasks/g87d9bbf-6d5e-4c43-9f03-6c5b2f5e28ee",
			"@type": "ManagedSlicerTask",
			"id": "g87d9bbf-6d5e-4c43-9f03-6c5b2f5e28ee",
			"state": "completed",
			"operation": "CREATE",
			"timestamp": 1646346005
		}, {
			"@id": "/api/v4/managed-slicer/slicers/tasks/a6151b9a-bb14-46cf-a479-d5c0e5bc0b4d",
			"@type": "ManagedSlicerTask",
			"id": "a6151b9a-bb14-46cf-a479-d5c0e5bc0b4d",
			"state": "completed",
			"operation": "CREATE",
			"timestamp": 1646932287
		}, {
			"@id": "/api/v4/managed-slicer/slicers/tasks/247016d9-3814-4858-a115-32efbaf8ac03",
			"@type": "ManagedSlicerTask",
			"id": "247016d9-3814-4858-a115-32efbaf8ac03",
			"state": "completed",
			"operation": "CREATE",
			"timestamp": 1647295968
		}, {
			"@id": "/api/v4/managed-slicer/slicers/tasks/h1dde543-8114-4af7-b690-13b8c0c05820",
			"@type": "ManagedSlicerTask",
			"id": "h1dde543-8114-4af7-b690-13b8c0c05820",
			"state": "completed",
			"operation": "CREATE",
			"timestamp": 1647296139
		}, {
			"@id": "/api/v4/managed-slicer/slicers/tasks/d236db57-bd85-449d-8373-d642f39eda84",
			"@type": "ManagedSlicerTask",
			"id": "d236db57-bd85-449d-8373-d642f39eda84",
			"state": "completed",
			"operation": "CREATE",
			"timestamp": 1647296804
		}
	],
	"total_items": 5
}