Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion msa_sdk/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
23 changes: 0 additions & 23 deletions msa_sdk/orchestration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""

Expand Down
2 changes: 1 addition & 1 deletion tests/test_device_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 0 additions & 19 deletions tests/test_orchestration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down