Get Device Health List
Description
Gets device health list via the web service.
Function Signature:
def get_device_health_list(ws_config: WebServiceConfig, device_id: int, start_epoch: int, end_epoch: int, count: int = 0, order: str = 'desc') -> DeviceHealthListResult:
Parameters
- ws_config (WebServiceConfig): Configuration for the web service connection.
- device_id (int): Device identifier.
- start_epoch (int): Input value for
start_epoch. - end_epoch (int): Input value for
end_epoch. - count (int): Input value for
count. - order (str): Input value for
order.
Returns
- DeviceHealthListResult: A result object containing:
code: HTTP status code (200 for success,-1for exceptions).description: Response body or error message.device_health_list: Parsed response data when available.
Example Usage
# Example usage
ws_config = WebServiceConfig(access_key="key", secret_key="secret", base_url="https://api.example.com/")
device_id = 1
start_epoch = 1
end_epoch = 1
count = 1
order = "example"
result = get_device_health_list(ws_config, device_id, start_epoch, end_epoch, count, order)
print(result)
Behavior
- Sends a signed request to the web service.
- On success (code 200), response data is parsed into the result object.
- On success, returns the computed value or result object.
Error Handling
- Exceptions set the result code to
-1and include an error message when implemented.