DevOps¶
Validated types for DevOps tooling: Docker, Helm, Kubernetes, Terraform, and Git.
Modules:
-
docker–Validated types for Docker image references.
-
git–Validated types for Git references and URLs.
-
helm–Validated types for Helm chart references.
-
k8s–Validated types for Kubernetes resource names and namespaces.
-
terraform–Validated types for Terraform resource identifiers.
Classes:
-
DockerImageRef–A Docker/OCI image reference like registry/repo:tag@digest.
-
GitHttpsUrl–A Git HTTPS clone URL like https://github.com/owner/repo.git with parsed properties.
-
GitSshUrl–A Git SSH clone URL like git@github.com:owner/repo.git with parsed properties.
-
K8sLabelKey–A valid Kubernetes label key with optional prefix and name.
-
TerraformResourceAddress–A Terraform resource address like aws_instance.web.
Attributes:
-
GitCommitSha–A full 40-character Git commit SHA-1 hash (normalized to lowercase) (e.g.
a94a8fe5ccb19ba61c4c0873d391e987982fbbd3). -
GitRef–A valid Git ref name (branch or tag) per git-check-ref-format rules (e.g.
main). -
GitShortSha–A Git short SHA prefix (7-40 hex characters, normalized to lowercase) (e.g.
a94a8fe). -
HelmChartName–A valid Helm chart name (e.g.
nginx). -
K8sLabelValue–A valid Kubernetes label value (max 63 chars, empty allowed) (e.g.
v1.0). -
K8sNamespaceName–A valid Kubernetes namespace name (RFC 1123 DNS label) (e.g.
default). -
K8sResourceName–A valid Kubernetes resource name (RFC 1123 DNS subdomain, max 253 chars) (e.g.
my-deployment).
GitCommitSha
module-attribute
¶
GitCommitSha = Annotated[str, AfterValidator(_validate_git_commit_sha), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A full 40-character Git commit SHA-1 hash (normalized to lowercase)', 'examples': ['a94a8fe5ccb19ba61c4c0873d391e987982fbbd3'], 'title': 'GitCommitSha', 'minLength': 40, 'maxLength': 40})]
A full 40-character Git commit SHA-1 hash (normalized to lowercase) (e.g. a94a8fe5ccb19ba61c4c0873d391e987982fbbd3).
GitRef
module-attribute
¶
GitRef = Annotated[str, AfterValidator(_validate_git_ref), WithJsonSchema({'type': 'string', 'description': 'A valid Git ref name (branch or tag) per git-check-ref-format rules', 'examples': ['main', 'feature/my-branch', 'refs/heads/main', 'v1.0'], 'title': 'GitRef', 'minLength': 1})]
A valid Git ref name (branch or tag) per git-check-ref-format rules (e.g. main).
GitShortSha
module-attribute
¶
GitShortSha = Annotated[str, AfterValidator(_validate_git_short_sha), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A Git short SHA prefix (7-40 hex characters, normalized to lowercase)', 'examples': ['a94a8fe'], 'title': 'GitShortSha', 'minLength': 7, 'maxLength': 40})]
A Git short SHA prefix (7-40 hex characters, normalized to lowercase) (e.g. a94a8fe).
HelmChartName
module-attribute
¶
HelmChartName = Annotated[str, AfterValidator(_validate_helm_chart_name), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A valid Helm chart name.', 'examples': ['nginx', 'cert-manager'], 'title': 'HelmChartName'})]
A valid Helm chart name (e.g. nginx).
K8sLabelValue
module-attribute
¶
K8sLabelValue = Annotated[str, AfterValidator(_validate_k8s_label_value), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A valid Kubernetes label value (max 63 chars, empty allowed).', 'examples': ['v1.0', 'production', ''], 'title': 'K8sLabelValue'})]
A valid Kubernetes label value (max 63 chars, empty allowed) (e.g. v1.0).
K8sNamespaceName
module-attribute
¶
K8sNamespaceName = Annotated[str, AfterValidator(_validate_k8s_namespace_name), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A valid Kubernetes namespace name (RFC 1123 DNS label).', 'examples': ['default', 'kube-system'], 'title': 'K8sNamespaceName'})]
A valid Kubernetes namespace name (RFC 1123 DNS label) (e.g. default).
K8sResourceName
module-attribute
¶
K8sResourceName = Annotated[str, AfterValidator(_validate_k8s_resource_name), WithJsonSchema({'type': 'string', 'pattern': pattern, 'description': 'A valid Kubernetes resource name (RFC 1123 DNS subdomain, max 253 chars).', 'examples': ['my-deployment', 'nginx-pod'], 'title': 'K8sResourceName'})]
A valid Kubernetes resource name (RFC 1123 DNS subdomain, max 253 chars) (e.g. my-deployment).
DockerImageRef
¶
Bases: str
A Docker/OCI image reference like registry/repo:tag@digest.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for DockerImageRef.
-
__get_pydantic_json_schema__–Return the JSON schema for DockerImageRef.
-
__new__–Create and validate a new DockerImageRef instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for DockerImageRef.
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for DockerImageRef.
Source code in src/pydantypes/devops/docker.py
__new__
¶
__new__(value: str) -> DockerImageRef
Create and validate a new DockerImageRef instance.
Source code in src/pydantypes/devops/docker.py
GitHttpsUrl
¶
Bases: str
A Git HTTPS clone URL like https://github.com/owner/repo.git with parsed properties.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for GitHttpsUrl.
-
__get_pydantic_json_schema__–Return the JSON schema for GitHttpsUrl.
-
__new__–Create and validate a new GitHttpsUrl instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for GitHttpsUrl.
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for GitHttpsUrl.
Source code in src/pydantypes/devops/git.py
__new__
¶
__new__(value: str) -> GitHttpsUrl
Create and validate a new GitHttpsUrl instance.
Source code in src/pydantypes/devops/git.py
GitSshUrl
¶
Bases: str
A Git SSH clone URL like git@github.com:owner/repo.git with parsed properties.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for GitSshUrl.
-
__get_pydantic_json_schema__–Return the JSON schema for GitSshUrl.
-
__new__–Create and validate a new GitSshUrl instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for GitSshUrl.
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for GitSshUrl.
Source code in src/pydantypes/devops/git.py
__new__
¶
__new__(value: str) -> GitSshUrl
Create and validate a new GitSshUrl instance.
Source code in src/pydantypes/devops/git.py
K8sLabelKey
¶
Bases: str
A valid Kubernetes label key with optional prefix and name.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for K8sLabelKey.
-
__get_pydantic_json_schema__–Return the JSON schema for K8sLabelKey.
-
__new__–Create and validate a new K8sLabelKey instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for K8sLabelKey.
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for K8sLabelKey.
Source code in src/pydantypes/devops/k8s.py
__new__
¶
__new__(value: str) -> K8sLabelKey
Create and validate a new K8sLabelKey instance.
Source code in src/pydantypes/devops/k8s.py
TerraformResourceAddress
¶
Bases: str
A Terraform resource address like aws_instance.web.
Methods:
-
__get_pydantic_core_schema__–Return the Pydantic core schema for TerraformResourceAddress.
-
__get_pydantic_json_schema__–Return the JSON schema for TerraformResourceAddress.
-
__new__–Create and validate a new TerraformResourceAddress instance.
__get_pydantic_core_schema__
classmethod
¶
Return the Pydantic core schema for TerraformResourceAddress.
Source code in src/pydantypes/devops/terraform.py
__get_pydantic_json_schema__
classmethod
¶
__get_pydantic_json_schema__(_core_schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue
Return the JSON schema for TerraformResourceAddress.
Source code in src/pydantypes/devops/terraform.py
__new__
¶
__new__(value: str) -> TerraformResourceAddress
Create and validate a new TerraformResourceAddress instance.