Skip to main content

Convenient package for implement Kubernetes controllers using Metacontroller.

Project description

python-metacontroller-api

API for implementing Kubernetes controllers via Metacontroller.

Example

from metacontroller_api import DecoratorController, DecoratorSyncRequest, DecoratorSyncResponse
from metacontroller_api.contrib.flask import serve
from metacontroller_api.types import CustomizeRequest, CustomizeResponse, FinalizeRequest, FinalizeResponse


class MyController(DecoratorController):
    def customize(self, request: CustomizeRequest) -> CustomizeResponse:
        # ...
        return {
            "relatedResources": [],
        }

    def sync(self, request: DecoratorSyncRequest) -> DecoratorSyncResponse:
        # ...
        return {
            "labels": {},
            "annotations": {},
            "status": {},
            "attachments": [],
            "resyncAfterSeconds": 0,
        }

    def finalize(self, request: FinalizeRequest) -> FinalizeResponse:
        # ...
        return {"finalized": True}uvx mksync README.md -i


serve(MyController())

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

metacontroller_api-0.3.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

metacontroller_api-0.3.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file metacontroller_api-0.3.0.tar.gz.

File metadata

  • Download URL: metacontroller_api-0.3.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for metacontroller_api-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7fbacff9d61c63418cbc747889fb56cfff40145a55953ac7399f387ab5dc2a74
MD5 975aff8acd40c4d04e2f691e7e134967
BLAKE2b-256 85cc18af2d38d0ae7c4cc66a179b7ba7e7ecd734385a1aacad0f817635e03bf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for metacontroller_api-0.3.0.tar.gz:

Publisher: python.yaml on NiklasRosenstein/python-metacontroller-api

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

File details

Details for the file metacontroller_api-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for metacontroller_api-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9048dc3a6d61abe2c4e3e747eafd4e9d25a053be7c4477bfcdd626960fcdaaf6
MD5 a2533cb52a2214cdc070f2144dbeab1c
BLAKE2b-256 71f2b4dc47ae453c826a482354c19cbd51b21a928780b57574c0632b979a92d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for metacontroller_api-0.3.0-py3-none-any.whl:

Publisher: python.yaml on NiklasRosenstein/python-metacontroller-api

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