diff --git a/msa_sdk/customer.py b/msa_sdk/customer.py index 8c12fba0..063d91ec 100644 --- a/msa_sdk/customer.py +++ b/msa_sdk/customer.py @@ -2,8 +2,8 @@ import json -from msa_sdk.msa_api import MSA_API from msa_sdk.device import Device +from msa_sdk.msa_api import MSA_API class Customer(MSA_API): diff --git a/msa_sdk/orchestration.py b/msa_sdk/orchestration.py index a8efcf3f..68b5dd82 100644 --- a/msa_sdk/orchestration.py +++ b/msa_sdk/orchestration.py @@ -649,29 +649,6 @@ def update_asynchronous_task_details(self, process_id: int, task_id: int, self.update_process_script_details( process_id, task_id, exec_number, details_json) - def get_list_service_by_status(self, range: int) -> dict: - """ - - List services by status. - - Parameters - ---------- - range: Integer - Number of days for the statistic - - Returns - ------- - Dict() - Key: Name of service - Value: Statistics by status - - """ - self.path = '{}/services?ubiqubeId={}&range={}'.format( - self.api_path_v1, self.ubiqube_id, range) - self._call_get() - - return json.loads(self.content) - def get_service_status_by_id(self, service_id: int): """ diff --git a/tests/test_device_get.py b/tests/test_device_get.py index 47c2099d..8681f5c0 100644 --- a/tests/test_device_get.py +++ b/tests/test_device_get.py @@ -26,7 +26,7 @@ def test_read_by_id(mock_post): mock_host_port.return_value = ('api_hostname', '8080') device = Device(device_id=21594) - assert device.path == '/device/v2/21594' + assert device.path == '/device/v3/21594' assert device.device_id == 21594 assert device.name == "Linux self MSA" assert device.manufacturer_id == 14020601 diff --git a/tests/test_orchestration.py b/tests/test_orchestration.py index 5f34c2b1..20375ce9 100644 --- a/tests/test_orchestration.py +++ b/tests/test_orchestration.py @@ -71,25 +71,6 @@ def test_get_service_variables_by_service_id(orchestration_fixture): assert orch.path == '/orchestration/service/variables/1234' assert _is_valid_json(orch.response.text) - -def test_get_list_service_by_status(orchestration_fixture): - """ - Test Get list of services by status - """ - response = ( - '{"Process/IP_CONTROLLER/Fulfilment_Dispatcher/Fulfilment_Dispatcher":' - '{"RUNNING":0,"ENDED":0,"WARNING":0,"FAIL":0},"Process/IP_CONTROLLER/' - 'Fulfilment_Handler/Fulfilment_Handler":{"RUNNING":0,"ENDED":0,' - '"WARNING":0,"FAIL":0}}') - - with patch('requests.get') as mock_call_get: - mock_call_get.return_value.text = response - orch = orchestration_fixture - orch.get_list_service_by_status(1) - assert orch.path == '/orchestration/v1/services?ubiqubeId=MSAA19224&range=1' - assert _is_valid_json(orch.response.text) - - def test_get_service_status_by_id(orchestration_fixture): """ Test Get service status by ID