Services

async OPNsenseClient.get_services()

Get the list of OPNsense services.

Returns:

Normalized data returned by the related OPNsense endpoint.

Return type:

list[dict[str, Any]]

async OPNsenseClient.get_service_is_running(service)

Return if the OPNsense service is running.

Parameters:

service (str) – Service name as reported by OPNsense.

Returns:

True when the checked condition is met; otherwise, False.

Return type:

bool

async OPNsenseClient.start_service(service)

Start an OPNsense service.

Parameters:

service (str) – Service name as reported by OPNsense.

Returns:

True when the operation succeeds; otherwise, False.

Return type:

bool

async OPNsenseClient.stop_service(service)

Stop an OPNsense service.

Parameters:

service (str) – Service name as reported by OPNsense.

Returns:

True when the operation succeeds; otherwise, False.

Return type:

bool

async OPNsenseClient.restart_service(service)

Restart an OPNsense service.

Parameters:

service (str) – Service name as reported by OPNsense.

Returns:

True when the operation succeeds; otherwise, False.

Return type:

bool

async OPNsenseClient.restart_service_if_running(service)

Restart an OPNsense service only when it is currently running.

Parameters:

service (str) – Service name as reported by OPNsense.

Returns:

True when the operation succeeds; otherwise, False.

Return type:

bool