diff --git a/msa_sdk/orchestration.py b/msa_sdk/orchestration.py index 7fe4c20c..a9904214 100644 --- a/msa_sdk/orchestration.py +++ b/msa_sdk/orchestration.py @@ -228,8 +228,7 @@ def delete_service(self, service_id): """ self.path = \ - '/orchestration/{}/service/instance/{}'.format(self.ubiqube_id, - service_id) + '/orchestration/v1/service/instance/{}'.format(service_id) self._call_delete() @@ -750,3 +749,25 @@ def attach_wf_to_subtenant(self, ubiqubeIds, uri): """ self.path = "{}/service/attach?ubiqubeIds={}&uri={}".format(self.api_path, ubiqubeIds, uri) self._call_post() + + def execute_delete_process(self, process_name: str, service_id: int): + """ + + Execute the deletion of a service. + + Parameters + ---------- + process_name: String + Process name + service_id: Integer + Service ID + + Returns + ------- + None + + """ + format_path = ('/orchestration/process/execute/{}/{}?processName={}') + self.path = format_path.format(self.ubiqube_id, service_id, process_name) + self._call_post() + diff --git a/tests/test_orchestration.py b/tests/test_orchestration.py index 0cf57e46..5016d7cc 100644 --- a/tests/test_orchestration.py +++ b/tests/test_orchestration.py @@ -167,7 +167,7 @@ def test_delete_service_by_id(orchestration_fixture): with patch('msa_sdk.msa_api.MSA_API._call_delete') as mock_call_delete: orch = orchestration_fixture orch.delete_service('1234') - assert orch.path == '/orchestration/MSAA19224/service/instance/1234' + assert orch.path == '/orchestration/v1/service/instance/1234' mock_call_delete.assert_called_once()