Health check#

High-level health check wrappers.

This module owns the business-logic layer on top of the HealthCheck gRPC service. The grpc service implementation lives in:

  • ansys.fluent.core._grpc_services.health_check_service (v1 proto API)

  • ansys.fluent.core._grpc_services.health_check_service_v0 (v0 proto API)

Class hierarchy#

HealthCheck

gRPC-based implementation (v1 and v0 proto API).

Classes:

HealthCheck(service)

Health check backed by the HealthCheck gRPC service.

class ansys.fluent.core.services.health_check.HealthCheck(service)#

Bases: AbstractHealthCheck

Health check backed by the HealthCheck gRPC service.

Classes:

Status(value[, names, module, qualname, ...])

Health check status.

Methods:

__init__(service)

Initialize HealthCheck.

check_health()

Check the health of the Fluent connection.

status()

Check health of Fluent connection.

wait_for_server(timeout)

Keeps a watch on the health of the Fluent connection.

Attributes:

is_serving

Checks whether Fluent is serving.

class Status(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

Health check status.

Attributes:

NOT_SERVING: int = 2#
SERVING: int = 1#
__init__(service)#

Initialize HealthCheck.

check_health()#

Check the health of the Fluent connection.

Returns:
Status
property is_serving: bool#

Checks whether Fluent is serving.

status()#

Check health of Fluent connection.

wait_for_server(timeout)#

Keeps a watch on the health of the Fluent connection.

Response changes only when the service’s serving status changes.

Parameters:
timeoutint

timeout in seconds

Raises:
TimeoutError

If the connection to the Fluent server could not be established within the timeout.