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:
Name | Data Type | Description |
---|---|---|
@id | String | Indicates the relative path to this endpoint. |
@type | String | Returns Collection. |
items | List of Dictionaries | Contains a list of your tasks. |
total_items | Number | Indicates the total number of tasks. |
items List
The items list describes each task through the following properties:
Name | Data Type | Description | ||
---|---|---|---|---|
@id | String | Indicates a relative path that returns this resource. | ||
@type | String | Returns ManagedSlicerTask. | ||
id | String | Indicates the task's system-defined ID. | ||
operation | String | Indicates the type of operation that was performed. Valid values are: CREATE | UPDATE | DELETE |
state | String | Indicates the task's current state. Learn more. | ||
timestamp | Number | Indicates the timestamp, in Unix time (seconds), at which the task was initiated. |
Sample Request/Response
Call the get_all_csl_slicer_tasks module (Python 3) to retrieve a list of your CSL slicer tasks. This module imports names from the api_auth module.
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
}