genos.api.health

Classes

BaseAPI(session, base_url[, timeout])

Base class for all Genos API endpoints with token validation and error handling.

HealthAPI(session, base_url[, timeout])

Wrapper class for the Health Check API endpoint.

class BaseAPI(session: Session, base_url: str, timeout: int = 30)[source]

Bases: ABC

Base class for all Genos API endpoints with token validation and error handling.

This class provides common functionality for all API endpoints, including: - Token validation and authentication error handling - Payment/credit insufficiency checking - Standardized error response handling - HTTP status code validation

Only responses with status code 200 are considered successful and will proceed to further analysis. All other status codes will raise appropriate exceptions with the received error message.

class HealthAPI(session: Session, base_url: str, timeout: int = 30)[source]

Bases: BaseAPI

Wrapper class for the Health Check API endpoint.

This class handles requests to the /health endpoint, allowing clients to verify that the Genos service is running and responsive.

check() dict[source]

Perform a health check request.

Returns:

JSON response from the health endpoint, typically containing:
  • ”status”: “healthy” or “unhealthy”

  • ”message”: optional status message

Return type:

dict

Raises:

APIRequestError – If the request fails or the server is unreachable.