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.2.0.tar.gz (29.6 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.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eoap_api_health_check-0.2.0.tar.gz
  • Upload date:
  • Size: 29.6 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.2.0.tar.gz
Algorithm Hash digest
SHA256 c79b8844dc5a87d9ba18a6b80a1528e8a5c147ad7652149eeb4fc4b94e4a9af9
MD5 a719aef4e51435549e9acaf48db43246
BLAKE2b-256 c024dab7db237c0b44e20a9121b7156184aafeb5a8fcd6fbf81ce5ab74e74ab3

See more details on using hashes here.

Provenance

The following attestation bundles were made for eoap_api_health_check-0.2.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for eoap_api_health_check-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f145a8cbe63ecd8b470adb8331a51cd8720773cc03341e6e5637a3cd9f17cdf
MD5 73caaf6b4833cfabffd8b9fcb65a7044
BLAKE2b-256 d0fc1ce7f2d0e4cb5190a9af1b07ce6df813a02af559fc57feb1fc47213bd6e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for eoap_api_health_check-0.2.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