Skip to main content

EOAP HTTP API Health Check

Project description

EOAP OpenAPI Health Check

PyPI - Version PyPI - Python Version

EOAP OpenAPI Health Check provides a shared contract for reporting the health of EOAP services and their dependencies. The contract follows the application/health+json Internet-Draft and exposes it as an OpenAPI 3.1 definition for a conventional GET /health endpoint.

The OpenAPI definition is the source of truth. It is used to generate:

  • Pydantic models, published on PyPI as eoap-api-health-check;
  • a rendered OpenAPI reference for the project documentation; and
  • a reusable API contract for services and tooling in any language.

What the contract describes

A health response has one of three outcomes:

  • pass (including the compatible aliases ok and up) for a healthy service;
  • warn for a service that remains available but has concerns; or
  • fail (including error and down) for an unhealthy service.

Responses can include service metadata, diagnostic notes, links, and checks grouped by dependency or sub-component. Each check can report an observed value, its unit, the observation time, affected endpoints, and diagnostic output.

See the project documentation for the design and usage overview, or inspect the OpenAPI source for the complete contract.

Install the Python models

pip install eoap-api-health-check

The generated models can be used to construct and validate health payloads:

from eoap_api_health_check import ComponentHealth, HealthyResponse, HealthyStatus

health = HealthyResponse(
    status=HealthyStatus.PASS,
    version="1.0.0",
    checks={
        "database:responseTime": [
            ComponentHealth(
                componentType="datastore",
                observedValue=42,
                observedUnit="ms",
                status=HealthyStatus.PASS,
            )
        ]
    },
)

payload = health.model_dump(by_alias=True, mode="json", exclude_none=True)

Property names in Python use snake_case; passing aliases such as componentType is also supported. Serializing with by_alias=True produces the camel-cased names defined by the wire format.

Development

Do not edit src/eoap_api_health_check/__init__.py directly: it is regenerated from schemas/openapi.yaml.

With Task installed, run the complete generation and validation workflow with:

task

Useful focused tasks are:

task process_schema         # regenerate the Pydantic models
task generate_openapi_docs  # refresh the documentation artifacts
task serve_docs             # build and serve the documentation locally

License

This project is licensed under the Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eoap_api_health_check-0.1.0.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eoap_api_health_check-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file eoap_api_health_check-0.1.0.tar.gz.

File metadata

  • Download URL: eoap_api_health_check-0.1.0.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for eoap_api_health_check-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a5a217b4d709a7ec34ba25e1e98fcee4655963182008826ff5788a201dc71ec0
MD5 3751c910063a2769afa442c6a805ea4b
BLAKE2b-256 03f6c36d0991cc32133c53f426bee23c0eaa4f5535336abfc84a966eaeaa718d

See more details on using hashes here.

Provenance

The following attestation bundles were made for eoap_api_health_check-0.1.0.tar.gz:

Publisher: package.yaml on Terradue/api-health-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eoap_api_health_check-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for eoap_api_health_check-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 411dbcd87e01367acb100949e0186cb2e34257a4e171afa6eb1f8d6e9c80c9a4
MD5 c678352ccf823c61b1a8c2f9578e1531
BLAKE2b-256 62b6f59e1cd551195723cc7e373904a2cf907df9acffbd64adf77b8651887529

See more details on using hashes here.

Provenance

The following attestation bundles were made for eoap_api_health_check-0.1.0-py3-none-any.whl:

Publisher: package.yaml on Terradue/api-health-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page