Schedule
- pyCSM.services.session_service.schedule_service.cancel_task(url, tk, taskid)
Cancel a running schedualed task.
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
taskid (str) – ID of the schedule task to cancel.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.change_properties(property_dictionary)
Takes a dictionary of properties and the values that user wants to change and changes them in the file.
- Parameters
property_dictionary (dict) – Dictionary of the keys and values that need
file. (to be changed in the) –
{"language" (ex.) – “en-UK”, “verify”:True}
- Returns
Returns the new properties dictionary.
- pyCSM.services.session_service.schedule_service.create_scheduled_task(url, tk, json)
Creates a new task with given task info
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
json (str) – json string of scheduled task info used to create new scheduled task
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.delete_task(url, tk, taskid)
This method is used to delete a schedualed task.
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
taskid (str) – ID of the schedule task to enable.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.disable_scheduled_task(url, tk, taskid)
Disable a scheduled task from running automatically.
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
taskid (str) – ID of the schedule task to enable.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.duplicate_scheduled_task(url, tk, taskid)
Duplicates scheduled task of a given id
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.enable_scheduled_task(url, tk, taskid)
Enable a scheduled task to run based off the schedule defined on the task.
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
taskid (str) – ID of the schedule task to enable.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.enable_scheduled_task_at_time(url, tk, task_id, start_time)
Enable the task at the given time
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
task_id (int) – ID of the schedule task to enable
start_time (str) – Time to enable the task.
yyyy-MM-dd'T'HH-mm. (Format of) –
- Returns
JSON String representing the result of the command. ‘I’ = successful,’W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.get_properties()
Returns a dictionary of the current properties and their values set for the file.
- pyCSM.services.session_service.schedule_service.get_scheduled_task(url, tk, taskid)
Returns the scheduled task info of a given task id
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.get_scheduled_tasks(url, tk)
Returns a list of scheduled tasks defined on the server
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.run_scheduled_task(url, tk, taskid, synchronous=False)
Run a scheduled task immediately. Synchronous value set to true if call should not return until task is complete. False if you want it to run in the asynchronous after the call completes.
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
taskid (str) – ID of the schedule task to enable.
- Returns
JSON String representing the result of the command. ‘I’ = successful, ‘W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.run_scheduled_task_at_time(url, tk, task_id, start_time)
Run a scheduled task immediately.
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
task_id (int) – ID of the schedule task to enable
start_time (str) – Time to enable the task.
yyyy-MM-dd'T'HH-mm. (Format of) –
- Returns
JSON String representing the result of the command. ‘I’ = successful,’W’ = warning, ‘E’ = error.
- pyCSM.services.session_service.schedule_service.run_task_now(url, tk, taskid, synchronous=False, step=0)
Run a scheduled task immediately at a specific step.
- Parameters
url (str) – Base url of csm server. ex. https://servername:port/CSM/web.
tk (str) – Rest token for the CSM server.
taskid (int/str) – ID of the schedule task to run.
synchronous (bool) – Whether to wait for the task to complete.
step (int) – The specific step number to start from.
- Returns
Response object representing the result of the command.