Source code for ska_sdp_config.entity.deployment

"""Deployment configuration entities."""

from typing import Annotated, Literal

from pydantic import Field

from .base import MultiEntityBaseModel


[docs] class Deployment(MultiEntityBaseModel): """ Deployment entity. Collects configuration information relating to a cluster configuration change. """ # Permit identifiers up to 96 bytes in length key: Annotated[str, Field(pattern="^[A-Za-z0-9\\-]{1,96}$")] kind: Literal["helm"] """The kind of deployment, currently only "helm" is supported.""" args: dict """ A dictionary of values used to customise the deployment. In the case of helm deployments, these are Helm values. """ # kept for backwards compatibility
[docs] def to_dict(self) -> dict: """ Returns a dictionary representation of this entity, kept for backwards compatibility. Prefer :meth:`model_dump`. """ return self.model_dump()
@property def dpl_id(self): """This Deployment's ID.""" return self.key