MonitorApi#

class ansys.hps.client.monitor.api.MonitorApi(client, ws_connection_options=None, timeout_seconds=10.0, ws_url=None)#

Client for the HPS monitor REST and WebSocket interfaces.

Parameters:
clientClient

Pre-authenticated HPS client. REST requests are routed through client.session and monitor URLs are derived from client.url.

ws_connection_optionsdict[str, Any], optional

Keyword arguments forwarded to websocket.create_connection for WebSocket calls. Useful for local or self-signed environments, for example {"sslopt": {"cert_reqs": ssl.CERT_NONE}}. The default is None.

timeout_secondsfloat, optional

Timeout in seconds used for all network operations. The default is 10.0.

ws_urlstr, optional

Full WebSocket URL override, for example wss://localhost:8443/hps/monitor/ws/topics. If omitted, the URL is derived from client.url. The default is None.

Notes

Common filter tags: client_type, task_id, project_id, job_id, evaluator_name, host, file_path, level. For metric messages: type=metric, statistic (e.g. process_tree). See ClientType for known client_type values.

Initialize the MonitorApi client.

Methods

MonitorApi.get_build_info()

Fetch monitor service build metadata from the REST API.

MonitorApi.get_task_process_tree(task_id, *)

Return process tree metric messages for a specific task.

MonitorApi.list_topics([limit, exclude_noisy])

List all known tag keys and their values via the WebSocket list_tags action.

MonitorApi.resolve_project_id_for_task(...)

Infer project ID for a task from task-log message tags.

MonitorApi.send_ws_command(command[, ...])

Send a command to the monitor WebSocket endpoint and collect messages.

MonitorApi.stream_scheduler_job_status(...)

Stream scheduler job status metrics for a task definition.

MonitorApi.stream_service_logs(client_type, *)

Stream log messages for a named HPS service.

MonitorApi.stream_task_host_resources(...[, ...])

Stream CPU and memory metric updates for the host running a specific task.

MonitorApi.stream_task_logs(task_id, *[, ...])

Stream log file messages for a specific task.

MonitorApi.stream_task_process_tree(task_id, *)

Stream process tree metric updates for a specific task.

Attributes

MonitorApi.base_url

Base URL for monitor endpoints derived from the authenticated client.

MonitorApi.token

JWT token sourced from the authenticated client when available.

MonitorApi.ws_url

WebSocket topics URL for the monitor endpoint.