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.2.tar.gz (13.8 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.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metacontroller_api-0.2.2.tar.gz
  • Upload date:
  • Size: 13.8 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.2.tar.gz
Algorithm Hash digest
SHA256 e9d63abcd473abc0dbd1fc45e0a3362b10e04586817a0a2ce345da32ad3ee96f
MD5 f7ee0161d6d9fb57e0c91db4ab43cd88
BLAKE2b-256 3907dd4702571d175d7f9f67b439e70f0ae8c64d512dfc86dac9846da71db0aa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for metacontroller_api-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e26576d59b8cd5c8f638f725e1e74fcb157daefdcd5690e9f3156e43cbd1e90
MD5 367bc54bebb6ac53fd971041cee580fb
BLAKE2b-256 6127352ac185a44129d5572b71a47be7285e51f7d42be8565c82ac07e4b97063

See more details on using hashes here.

Provenance

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