Retrieves information about a CSL slicer task.
Request
Request syntax:
GET /managed-slicer/slicers/tasks/{Task ID}
Request URL variable:
Define the following variable when submitting the above request:
| Variable | Description |
|---|---|
| Task ID | Required. Replace this variable with the system-defined ID assigned to the desired task. Use the Get All Tasks endpoint to retrieve a list of tasks and their system-defined IDs. |
Response
The response for a successful request contains 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
The code below (Python 3) shows how to retrieve information about a CSL slicer task.
This code imports names from the api_auth module for V4 APIs (see below).
import requests
from api_auth import APICredentials, APIParams
class Task:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
self._get_csl_slicer_task()
def _get_csl_slicer_task(self):
task_id = '910594f1-7224-43f9-911c-93fb5925b337' # Replace with the desired task ID.
url = "{}{}{}".format(self.host, "/api/v4/managed-slicer/slicers/tasks/", task_id)
headers = {'Content-Type': 'application/json'}
response = requests.get(
url, params=APIParams(APICredentials()).get_params({}), headers=headers
)
print(response.json())
Task().run()Response:
{
"@id": "/api/v4/managed-slicer/slicers/tasks/910594f1-7224-43f9-911c-93fb5925b337",
"@type": "ManagedSlicerTask",
"id": "910594f1-7224-43f9-911c-93fb5925b337",
"state": "COMPLETED",
"operation": "DELETE",
"timestamp": 1663984282
}