diff --git a/SAS/TMSS/client/lib/tmss_http_rest_client.py b/SAS/TMSS/client/lib/tmss_http_rest_client.py index 2409220e473145e083b3e0b72b91adb7649908dc..a4175393de18e50a6e0d4f19170fc27bcaf75780 100644 --- a/SAS/TMSS/client/lib/tmss_http_rest_client.py +++ b/SAS/TMSS/client/lib/tmss_http_rest_client.py @@ -324,6 +324,21 @@ class TMSSsession(object): self.session.patch(self.get_full_url_for_path('subtask/%s' % subtask_id), {'start_time': datetime.utcnow()}) return self.get_path_as_json_object('subtask/%s/schedule' % subtask_id) + def cancel_subtask(self, subtask_id: int) -> {}: + """cancel the subtask for the given subtask_id, either preventing it to start, or to kill it while running. + returns the cancelled subtask upon success, or raises.""" + return self.get_path_as_json_object('subtask/%s/cancel' % subtask_id) + + def cancel_task_blueprint(self, task_blueprint_id: int) -> {}: + """cancel the task_blueprint for the given task_blueprint_id, either preventing it to start, or to kill it while running. + returns the cancelled task_blueprint upon success, or raises.""" + return self.get_path_as_json_object('task_blueprint/%s/cancel' % task_blueprint_id) + + def cancel_scheduling_unit_blueprint(self, scheduling_unit_blueprint_id: int) -> {}: + """cancel the scheduling_unit_blueprint for the given scheduling_unit_blueprint_id, either preventing it to start, or to kill it while running. + returns the cancelled scheduling_unit_blueprint upon success, or raises.""" + return self.get_path_as_json_object('scheduling_unit_blueprint/%s/cancel' % scheduling_unit_blueprint_id) + def create_blueprints_and_subtasks_from_scheduling_unit_draft(self, scheduling_unit_draft_id: int) -> {}: """create a scheduling_unit_blueprint, its specified taskblueprints and subtasks for the given scheduling_unit_draft_id. returns the scheduled subtask upon success, or raises."""