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.2.1.tar.gz (13.7 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.2.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metacontroller_api-0.2.1.tar.gz
  • Upload date:
  • Size: 13.7 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.2.1.tar.gz
Algorithm Hash digest
SHA256 e6c02c1f835056a4a3c3c4816c1ea432012d1c7a8a4aa5bea7ab757b7024133f
MD5 0aa0511851dfdb4231d5d9da4bce418e
BLAKE2b-256 bbcec040f57ba3eeb2a22a0f5087c6bd982063a7c392e7fd4d3a9451cf3ed7f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for metacontroller_api-0.2.1.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.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for metacontroller_api-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68803f5b178db7761c1ba2a51640657be0d99f2f1fb2c8a0236d9e7769ff8962
MD5 c6a3ebb04ffb43f3a5b4e2af7be3a499
BLAKE2b-256 85601a6bad3b39f5c866c6fb3524c87c0f2ab5dd989b65901c7e9be1394ec1cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for metacontroller_api-0.2.1-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