From b450e6438fd6fd7be020cf300e599f79ef22afe0 Mon Sep 17 00:00:00 2001 From: pierrerondel Date: Thu, 4 Sep 2025 08:58:36 +0200 Subject: [PATCH 1/2] Update orchestration.py - change the endpoint of delete_service - add a new endpoint: execute_delete_process(self, process_name: str, service_id: int): --- msa_sdk/orchestration.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) 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() + From dd5beb8f1684ef23ab2816cd089a7cfbaed33314 Mon Sep 17 00:00:00 2001 From: pierrerondel Date: Thu, 4 Sep 2025 09:09:45 +0200 Subject: [PATCH 2/2] Update test_orchestration.py update test of delete_service --- tests/test_orchestration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()