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

Uploaded Python 3

File details

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

File metadata

  • Download URL: metacontroller_api-0.2.0.tar.gz
  • Upload date:
  • Size: 13.6 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.0.tar.gz
Algorithm Hash digest
SHA256 4ff725ca42b110d2f0028b2301688b538d60ce17c78e69ea1d1f4485d959b305
MD5 7a92fe7d6d839be881f71e2f3bccc42b
BLAKE2b-256 938211cea931aafb3982bdffbbaa8e2502c3a3e12eae9d761d207c786b594fa8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for metacontroller_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 555d57e537b0df836e61213d4c225aba88187010d755b8dc97c91aa8b4438094
MD5 bee42465924cfbc830af2f682d51f923
BLAKE2b-256 5efda06b359810773bf3ca7ae38400823be1a96985860e8deb43051fb6778dd0

See more details on using hashes here.

Provenance

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