Health API¶
API wrapper for accessing the /health endpoints of the openvasd HTTP API.
- class HealthAPI¶
Provides access to the openvasd /health endpoints, which expose the operational state of the scanner.
All methods return the HTTP status code of the response and raise an exception if the server returns an error response (4xx or 5xx).
- get_alive()¶
Check if the scanner process is alive.
- Returns:
HTTP status code (e.g., 200 if alive).
- Raises:
httpx.HTTPStatusError – If the server response indicates failure and exceptions are not suppressed.
- Return type:
int
See: GET /health/alive in the openvasd API documentation.
- get_ready()¶
Check if the scanner is ready to accept requests (e.g., feed loaded).
- Returns:
HTTP status code (e.g., 200 if ready).
- Raises:
httpx.HTTPStatusError – If the server response indicates failure and exceptions are not suppressed.
- Return type:
int
See: GET /health/ready in the openvasd API documentation.
- get_started()¶
Check if the scanner has fully started.
- Returns:
HTTP status code (e.g., 200 if started).
- Raises:
httpx.HTTPStatusError – If the server response indicates failure and exceptions are not suppressed.
- Return type:
int
See: GET /health/started in the openvasd API documentation.