Restarts a CSL slicer.
Request
Request syntax:
GET /managed-slicer/slicers/restart/CSL Slicer ID
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 ManagedSlicer. |
task | Dictionary | Describes the task associated with this request to restart a CSL slicer. |
task Dictionary
The task dictionary describes the task associated with this request to restart a CSL slicer through the following properties:
Name | Data Type | Description |
---|---|---|
id | String | Indicates the task's system-defined ID. |
state | String | Indicates the task's current state. |
operation | String | Indicates the type of operation that was performed. |
Sample Request/Response
Call the restart_csl_slicer module (Python 3) to restart a CSL slicer. This module imports names from the api_auth module.
import requests
from api_auth import APICredentials, APIParams
class CSLSlicer:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
self._restart_csl_slicer()
def _restart_csl_slicer(self):
csl_slicer_id = '262cb37a4c254df9946145917f3ce629' # Replace with the desired CSL slicer ID.
url = "{}{}{}".format(self.host, "/api/v4/managed-slicer/slicers/restart/", csl_slicer_id)
headers = {'Content-Type': 'application/json'}
response = requests.get(
url, params=APIParams(APICredentials()).get_params({}), headers=headers
)
print(response.json())
CSLSlicer().run()
Response:
{
'@id': '/api/v4/managed-slicer/slicers/restart/262cb37a4c254df9946145917f3ce629',
'@type': 'ManagedSlicer',
'task': {
'id': '9849d233-ea4d-41e2-bc18-192a0be7398b',
'state': 'IN_PROGRESS',
'operation': 'RESTART'
}
}