diff --git a/Makefile b/Makefile index f0132a31c..e66a8285b 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ install: ## Run poetry install with all extras for development .PHONY: install-3.8 install-3.8: ## Install python3.8 for generating test data @poetry env use 3.8 - @poetry install + @poetry install --all-extras .PHONY: ci ci: ## Run all the CI checks @@ -61,11 +61,11 @@ workflows-models: ## Generate the Workflows models portion of Argo Workflows --wrap-string-literal \ --disable-appending-item-suffix \ --disable-timestamp \ + --use-annotated \ --use-default-kwarg @find src/hera/workflows/models/ -name '*.py' -exec sed -i.bak 's/from pydantic import Field/from hera.shared._pydantic import Field/' {} + @find src/hera/workflows/models/ -name '*.bak' -delete @poetry run python scripts/models.py $(OPENAPI_SPEC_URL) workflows - @poetry run stubgen -o src -p hera.workflows.models && find src/hera/workflows/models -name '__init__.pyi' -delete @rm $(SPEC_PATH) @$(MAKE) format @@ -84,11 +84,11 @@ events-models: ## Generate the Events models portion of Argo Workflows --wrap-string-literal \ --disable-appending-item-suffix \ --disable-timestamp \ + --use-annotated \ --use-default-kwarg @find src/hera/events/models/ -name '*.py' -exec sed -i.bak 's/from pydantic import Field/from hera.shared._pydantic import Field/' {} + @find src/hera/events/models/ -name '*.bak' -delete @poetry run python scripts/models.py $(OPENAPI_SPEC_URL) events - @poetry run stubgen -o src -p hera.events.models && find src/hera/events/models -name '__init__.pyi' -delete @rm $(SPEC_PATH) @$(MAKE) format diff --git a/docs/examples/workflows-examples.md b/docs/examples/workflows-examples.md index d5eeba529..a0c56e5e7 100644 --- a/docs/examples/workflows-examples.md +++ b/docs/examples/workflows-examples.md @@ -107,6 +107,7 @@ Explore the examples through the side bar! | [template-defaults](https://github.com/argoproj/argo-workflows/blob/main/examples/template-defaults.yaml) | | [testvolume](https://github.com/argoproj/argo-workflows/blob/main/examples/testvolume.yaml) | | [timeouts-step](https://github.com/argoproj/argo-workflows/blob/main/examples/timeouts-step.yaml) | +| [title-and-descriptin-with-markdown](https://github.com/argoproj/argo-workflows/blob/main/examples/title-and-descriptin-with-markdown.yaml) | | [work-avoidance](https://github.com/argoproj/argo-workflows/blob/main/examples/work-avoidance.yaml) | | [workflow-count-resourcequota](https://github.com/argoproj/argo-workflows/blob/main/examples/workflow-count-resourcequota.yaml) | | [workflow-event-binding/event-consumer-workfloweventbinding](https://github.com/argoproj/argo-workflows/blob/main/examples/workflow-event-binding/event-consumer-workfloweventbinding.yaml) | diff --git a/docs/examples/workflows/global_config.md b/docs/examples/workflows/global_config.md index 4b6dfe426..7db61374e 100644 --- a/docs/examples/workflows/global_config.md +++ b/docs/examples/workflows/global_config.md @@ -41,7 +41,7 @@ entrypoint: whalesay serviceAccountName: argo-account templates: - - activeDeadlineSeconds: '100' + - activeDeadlineSeconds: 100 container: command: - cowsay diff --git a/docs/examples/workflows/upstream/default_pdb_support.md b/docs/examples/workflows/upstream/default_pdb_support.md index 98edda42d..c9de39cd2 100644 --- a/docs/examples/workflows/upstream/default_pdb_support.md +++ b/docs/examples/workflows/upstream/default_pdb_support.md @@ -41,7 +41,7 @@ The upstream example can be [found here](https://github.com/argoproj/argo-workfl spec: entrypoint: pdbcreate podDisruptionBudget: - minAvailable: '9999' + minAvailable: 9999 serviceAccountName: default templates: - container: diff --git a/docs/examples/workflows/upstream/retry_backoff.md b/docs/examples/workflows/upstream/retry_backoff.md index 0c200c33f..3e90f0aad 100644 --- a/docs/examples/workflows/upstream/retry_backoff.md +++ b/docs/examples/workflows/upstream/retry_backoff.md @@ -47,7 +47,7 @@ spec: command=["python", "-c"], args=["import random; import sys; exit_code = random.choice([0, 1, 1]); sys.exit(exit_code)"], retry_strategy=RetryStrategy( - limit=10, + limit="10", backoff=m.Backoff( duration="1", factor="2", diff --git a/docs/examples/workflows/upstream/retry_container.md b/docs/examples/workflows/upstream/retry_container.md index 7ffd227d4..96fd089df 100644 --- a/docs/examples/workflows/upstream/retry_container.md +++ b/docs/examples/workflows/upstream/retry_container.md @@ -19,7 +19,7 @@ The upstream example can be [found here](https://github.com/argoproj/argo-workfl image="python:alpine3.6", command=["python", "-c"], args=["import random; import sys; exit_code = random.choice([0, 1, 1]); sys.exit(exit_code)"], - retry_strategy=RetryStrategy(limit=10), + retry_strategy=RetryStrategy(limit="10"), ) ``` diff --git a/docs/examples/workflows/upstream/retry_script.md b/docs/examples/workflows/upstream/retry_script.md index 1b9c42619..17e3afdf0 100644 --- a/docs/examples/workflows/upstream/retry_script.md +++ b/docs/examples/workflows/upstream/retry_script.md @@ -14,7 +14,7 @@ The upstream example can be [found here](https://github.com/argoproj/argo-workfl from hera.workflows import RetryStrategy, Workflow, script - @script(image="python:alpine3.6", retry_strategy=RetryStrategy(limit=10), add_cwd_to_sys_path=False) + @script(image="python:alpine3.6", retry_strategy=RetryStrategy(limit="10"), add_cwd_to_sys_path=False) def retry_script(): import random import sys diff --git a/docs/examples/workflows/volume_mounts_nfs.md b/docs/examples/workflows/volume_mounts_nfs.md index 046a84acb..bbf756b01 100644 --- a/docs/examples/workflows/volume_mounts_nfs.md +++ b/docs/examples/workflows/volume_mounts_nfs.md @@ -38,8 +38,6 @@ server="your.nfs.server", mount_path="/mnt/nfs", path="/share/nfs", - size="1Gi", - storage_class_name="nfs-client", ) ], entrypoint="d", diff --git a/examples/workflows/global-config.yaml b/examples/workflows/global-config.yaml index d834371c1..e01ea8401 100644 --- a/examples/workflows/global-config.yaml +++ b/examples/workflows/global-config.yaml @@ -7,7 +7,7 @@ spec: entrypoint: whalesay serviceAccountName: argo-account templates: - - activeDeadlineSeconds: '100' + - activeDeadlineSeconds: 100 container: command: - cowsay diff --git a/examples/workflows/upstream/default-pdb-support.yaml b/examples/workflows/upstream/default-pdb-support.yaml index 8759060a4..a36f6ef3a 100644 --- a/examples/workflows/upstream/default-pdb-support.yaml +++ b/examples/workflows/upstream/default-pdb-support.yaml @@ -5,7 +5,7 @@ metadata: spec: entrypoint: pdbcreate podDisruptionBudget: - minAvailable: '9999' + minAvailable: 9999 serviceAccountName: default templates: - container: diff --git a/examples/workflows/upstream/input-artifact-s3.upstream.yaml b/examples/workflows/upstream/input-artifact-s3.upstream.yaml index 046831c08..25a6e9812 100644 --- a/examples/workflows/upstream/input-artifact-s3.upstream.yaml +++ b/examples/workflows/upstream/input-artifact-s3.upstream.yaml @@ -27,7 +27,7 @@ spec: key: path/in/bucket # Specify the bucket region. Note that if you want Argo to figure out this automatically, # you can set additional statement policy that allows `s3:GetBucketLocation` action. - # For details, check out: https://argoproj.github.io/argo-workflows/configure-artifact-repository/#configuring-aws-s3 + # For details, check out: https://argo-workflows.readthedocs.io/en/latest/configure-artifact-repository/#configuring-aws-s3 region: us-west-2 # accessKeySecret and secretKeySecret are secret selectors. # It references the k8s secret named 'my-s3-credentials'. diff --git a/examples/workflows/upstream/intermediate-parameters.upstream.yaml b/examples/workflows/upstream/intermediate-parameters.upstream.yaml index e8e176d52..67a46ff32 100644 --- a/examples/workflows/upstream/intermediate-parameters.upstream.yaml +++ b/examples/workflows/upstream/intermediate-parameters.upstream.yaml @@ -1,5 +1,5 @@ # This example demonstrates the ability to use intermediate parameter. -# See https://argoproj.github.io/argo-workflows/intermediate-inputs/ for details. +# See https://argo-workflows.readthedocs.io/en/latest/intermediate-inputs/ for details. apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: diff --git a/examples/workflows/upstream/key-only-artifact.upstream.yaml b/examples/workflows/upstream/key-only-artifact.upstream.yaml index 7dd8404f0..ef0a6360e 100644 --- a/examples/workflows/upstream/key-only-artifact.upstream.yaml +++ b/examples/workflows/upstream/key-only-artifact.upstream.yaml @@ -1,5 +1,5 @@ # this example shows how to use key-only artifacts - introduced in v3.0 -# https://argoproj.github.io/argo-workflows/key-only-artifacts/ +# https://argo-workflows.readthedocs.io/en/latest/key-only-artifacts/ apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: diff --git a/examples/workflows/upstream/output-artifact-s3.upstream.yaml b/examples/workflows/upstream/output-artifact-s3.upstream.yaml index 7c39a4952..b1e475803 100644 --- a/examples/workflows/upstream/output-artifact-s3.upstream.yaml +++ b/examples/workflows/upstream/output-artifact-s3.upstream.yaml @@ -32,7 +32,7 @@ spec: bucket: my-bucket # Specify the bucket region. Note that if you want Argo to figure out this automatically, # you can set additional statement policy that allows `s3:GetBucketLocation` action. - # For details, check out: https://argoproj.github.io/argo-workflows/configure-artifact-repository/#configuring-aws-s3 + # For details, check out: https://argo-workflows.readthedocs.io/en/latest/configure-artifact-repository/#configuring-aws-s3 region: us-west-2 # NOTE: by default, output artifacts are automatically tarred and gzipped before saving. diff --git a/examples/workflows/upstream/retry_backoff.py b/examples/workflows/upstream/retry_backoff.py index 35237fa22..06bdd5805 100644 --- a/examples/workflows/upstream/retry_backoff.py +++ b/examples/workflows/upstream/retry_backoff.py @@ -37,7 +37,7 @@ command=["python", "-c"], args=["import random; import sys; exit_code = random.choice([0, 1, 1]); sys.exit(exit_code)"], retry_strategy=RetryStrategy( - limit=10, + limit="10", backoff=m.Backoff( duration="1", factor="2", diff --git a/examples/workflows/upstream/retry_container.py b/examples/workflows/upstream/retry_container.py index 90b232f79..e3026bcda 100644 --- a/examples/workflows/upstream/retry_container.py +++ b/examples/workflows/upstream/retry_container.py @@ -6,5 +6,5 @@ image="python:alpine3.6", command=["python", "-c"], args=["import random; import sys; exit_code = random.choice([0, 1, 1]); sys.exit(exit_code)"], - retry_strategy=RetryStrategy(limit=10), + retry_strategy=RetryStrategy(limit="10"), ) diff --git a/examples/workflows/upstream/retry_script.py b/examples/workflows/upstream/retry_script.py index 9fb59a327..9e734144a 100644 --- a/examples/workflows/upstream/retry_script.py +++ b/examples/workflows/upstream/retry_script.py @@ -1,7 +1,7 @@ from hera.workflows import RetryStrategy, Workflow, script -@script(image="python:alpine3.6", retry_strategy=RetryStrategy(limit=10), add_cwd_to_sys_path=False) +@script(image="python:alpine3.6", retry_strategy=RetryStrategy(limit="10"), add_cwd_to_sys_path=False) def retry_script(): import random import sys diff --git a/examples/workflows/volume_mounts_nfs.py b/examples/workflows/volume_mounts_nfs.py index 93c80648e..fdad794d3 100644 --- a/examples/workflows/volume_mounts_nfs.py +++ b/examples/workflows/volume_mounts_nfs.py @@ -28,8 +28,6 @@ def foo(): server="your.nfs.server", mount_path="/mnt/nfs", path="/share/nfs", - size="1Gi", - storage_class_name="nfs-client", ) ], entrypoint="d", diff --git a/poetry.lock b/poetry.lock index ccdf2828e..dff8a3f00 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,9 +1,10 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. [[package]] name = "annotated-types" version = "0.6.0" description = "Reusable constraint types to use with typing.Annotated" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -18,6 +19,7 @@ typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} name = "anyio" version = "4.2.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -40,6 +42,7 @@ trio = ["trio (>=0.23)"] name = "argcomplete" version = "3.2.1" description = "Bash tab completion for argparse" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -54,6 +57,7 @@ test = ["coverage", "mypy", "pexpect", "ruff", "wheel"] name = "black" version = "23.12.0" description = "The uncompromising code formatter." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -100,6 +104,7 @@ uvloop = ["uvloop (>=0.15.2)"] name = "build" version = "1.0.3" description = "A simple, correct Python build frontend" +category = "dev" optional = false python-versions = ">= 3.7" files = [ @@ -124,6 +129,7 @@ virtualenv = ["virtualenv (>=20.0.35)"] name = "cappa" version = "0.15.2" description = "Declarative CLI argument parser." +category = "main" optional = true python-versions = ">=3.8,<4" files = [ @@ -143,6 +149,7 @@ docstring = ["docstring-parser (>=0.15)"] name = "certifi" version = "2023.11.17" description = "Python package for providing Mozilla's CA Bundle." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -154,6 +161,7 @@ files = [ name = "charset-normalizer" version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -253,6 +261,7 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -267,6 +276,7 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." +category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -278,6 +288,7 @@ files = [ name = "coverage" version = "7.3.3" description = "Code coverage measurement for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -345,6 +356,7 @@ toml = ["tomli"] name = "datamodel-code-generator" version = "0.25.1" description = "Datamodel Code Generator" +category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ @@ -363,7 +375,7 @@ jinja2 = ">=2.10.1,<4.0" packaging = "*" pydantic = [ {version = ">=1.10.0,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.12\" and python_version < \"4.0\""}, - {version = ">=1.10.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=1.10.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"4.0\""}, {version = ">=1.5.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version < \"3.10\""}, {version = ">=1.9.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, ] @@ -380,6 +392,7 @@ validation = ["openapi-spec-validator (>=0.2.8,<0.7.0)", "prance (>=0.18.2)"] name = "dnspython" version = "2.4.2" description = "DNS toolkit" +category = "main" optional = false python-versions = ">=3.8,<4.0" files = [ @@ -399,6 +412,7 @@ wmi = ["wmi (>=1.5.1,<2.0.0)"] name = "email-validator" version = "2.1.0.post1" description = "A robust email address syntax and deliverability validation library." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -414,6 +428,7 @@ idna = ">=2.0.0" name = "exceptiongroup" version = "1.2.0" description = "Backport of PEP 654 (exception groups)" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -428,6 +443,7 @@ test = ["pytest (>=6)"] name = "genson" version = "1.2.2" description = "GenSON is a powerful, user-friendly JSON Schema generator." +category = "dev" optional = false python-versions = "*" files = [ @@ -438,6 +454,7 @@ files = [ name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -449,6 +466,7 @@ files = [ name = "httpcore" version = "1.0.2" description = "A minimal low-level HTTP client." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -463,13 +481,14 @@ h11 = ">=0.13,<0.15" [package.extras] asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] trio = ["trio (>=0.22.0,<0.23.0)"] [[package]] name = "httpx" version = "0.25.2" description = "The next generation HTTP client." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -480,20 +499,21 @@ files = [ [package.dependencies] anyio = "*" certifi = "*" -httpcore = "==1.*" +httpcore = ">=1.0.0,<2.0.0" idna = "*" sniffio = "*" [package.extras] brotli = ["brotli", "brotlicffi"] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] [[package]] name = "idna" version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -505,6 +525,7 @@ files = [ name = "importlib-metadata" version = "7.0.0" description = "Read metadata from Python packages" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -524,6 +545,7 @@ testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs name = "inflect" version = "5.6.2" description = "Correctly generate plurals, singular nouns, ordinals, indefinite articles; convert numbers to words" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -539,6 +561,7 @@ testing = ["pygments", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdo name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -550,6 +573,7 @@ files = [ name = "isort" version = "5.13.2" description = "A Python utility / library to sort Python imports." +category = "dev" optional = false python-versions = ">=3.8.0" files = [ @@ -564,6 +588,7 @@ colors = ["colorama (>=0.4.6)"] name = "jinja2" version = "3.1.2" description = "A very fast and expressive template engine." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -581,6 +606,7 @@ i18n = ["Babel (>=2.7)"] name = "jsonpath-ng" version = "1.6.0" description = "A final implementation of JSONPath for Python that aims to be standard compliant, including arithmetic and binary comparison operators and providing clear AST for metaprogramming." +category = "dev" optional = false python-versions = "*" files = [ @@ -595,6 +621,7 @@ ply = "*" name = "markdown-it-py" version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -619,6 +646,7 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] name = "markupsafe" version = "2.1.3" description = "Safely add untrusted strings to HTML/XML markup." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -688,6 +716,7 @@ files = [ name = "mdurl" version = "0.1.2" description = "Markdown URL utilities" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -697,54 +726,57 @@ files = [ [[package]] name = "mypy" -version = "1.0.1" +version = "1.8.0" description = "Optional static typing for Python" +category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "mypy-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:71a808334d3f41ef011faa5a5cd8153606df5fc0b56de5b2e89566c8093a0c9a"}, - {file = "mypy-1.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:920169f0184215eef19294fa86ea49ffd4635dedfdea2b57e45cb4ee85d5ccaf"}, - {file = "mypy-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:27a0f74a298769d9fdc8498fcb4f2beb86f0564bcdb1a37b58cbbe78e55cf8c0"}, - {file = "mypy-1.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:65b122a993d9c81ea0bfde7689b3365318a88bde952e4dfa1b3a8b4ac05d168b"}, - {file = "mypy-1.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:5deb252fd42a77add936b463033a59b8e48eb2eaec2976d76b6878d031933fe4"}, - {file = "mypy-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2013226d17f20468f34feddd6aae4635a55f79626549099354ce641bc7d40262"}, - {file = "mypy-1.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:48525aec92b47baed9b3380371ab8ab6e63a5aab317347dfe9e55e02aaad22e8"}, - {file = "mypy-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c96b8a0c019fe29040d520d9257d8c8f122a7343a8307bf8d6d4a43f5c5bfcc8"}, - {file = "mypy-1.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:448de661536d270ce04f2d7dddaa49b2fdba6e3bd8a83212164d4174ff43aa65"}, - {file = "mypy-1.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:d42a98e76070a365a1d1c220fcac8aa4ada12ae0db679cb4d910fabefc88b994"}, - {file = "mypy-1.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e64f48c6176e243ad015e995de05af7f22bbe370dbb5b32bd6988438ec873919"}, - {file = "mypy-1.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fdd63e4f50e3538617887e9aee91855368d9fc1dea30da743837b0df7373bc4"}, - {file = "mypy-1.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dbeb24514c4acbc78d205f85dd0e800f34062efcc1f4a4857c57e4b4b8712bff"}, - {file = "mypy-1.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a2948c40a7dd46c1c33765718936669dc1f628f134013b02ff5ac6c7ef6942bf"}, - {file = "mypy-1.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5bc8d6bd3b274dd3846597855d96d38d947aedba18776aa998a8d46fabdaed76"}, - {file = "mypy-1.0.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:17455cda53eeee0a4adb6371a21dd3dbf465897de82843751cf822605d152c8c"}, - {file = "mypy-1.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e831662208055b006eef68392a768ff83596035ffd6d846786578ba1714ba8f6"}, - {file = "mypy-1.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e60d0b09f62ae97a94605c3f73fd952395286cf3e3b9e7b97f60b01ddfbbda88"}, - {file = "mypy-1.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:0af4f0e20706aadf4e6f8f8dc5ab739089146b83fd53cb4a7e0e850ef3de0bb6"}, - {file = "mypy-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:24189f23dc66f83b839bd1cce2dfc356020dfc9a8bae03978477b15be61b062e"}, - {file = "mypy-1.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:93a85495fb13dc484251b4c1fd7a5ac370cd0d812bbfc3b39c1bafefe95275d5"}, - {file = "mypy-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f546ac34093c6ce33f6278f7c88f0f147a4849386d3bf3ae193702f4fe31407"}, - {file = "mypy-1.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c6c2ccb7af7154673c591189c3687b013122c5a891bb5651eca3db8e6c6c55bd"}, - {file = "mypy-1.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:15b5a824b58c7c822c51bc66308e759243c32631896743f030daf449fe3677f3"}, - {file = "mypy-1.0.1-py3-none-any.whl", hash = "sha256:eda5c8b9949ed411ff752b9a01adda31afe7eae1e53e946dbdf9db23865e66c4"}, - {file = "mypy-1.0.1.tar.gz", hash = "sha256:28cea5a6392bb43d266782983b5a4216c25544cd7d80be681a155ddcdafd152d"}, + {file = "mypy-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:485a8942f671120f76afffff70f259e1cd0f0cfe08f81c05d8816d958d4577d3"}, + {file = "mypy-1.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:df9824ac11deaf007443e7ed2a4a26bebff98d2bc43c6da21b2b64185da011c4"}, + {file = "mypy-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2afecd6354bbfb6e0160f4e4ad9ba6e4e003b767dd80d85516e71f2e955ab50d"}, + {file = "mypy-1.8.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8963b83d53ee733a6e4196954502b33567ad07dfd74851f32be18eb932fb1cb9"}, + {file = "mypy-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:e46f44b54ebddbeedbd3d5b289a893219065ef805d95094d16a0af6630f5d410"}, + {file = "mypy-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:855fe27b80375e5c5878492f0729540db47b186509c98dae341254c8f45f42ae"}, + {file = "mypy-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4c886c6cce2d070bd7df4ec4a05a13ee20c0aa60cb587e8d1265b6c03cf91da3"}, + {file = "mypy-1.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d19c413b3c07cbecf1f991e2221746b0d2a9410b59cb3f4fb9557f0365a1a817"}, + {file = "mypy-1.8.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9261ed810972061388918c83c3f5cd46079d875026ba97380f3e3978a72f503d"}, + {file = "mypy-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:51720c776d148bad2372ca21ca29256ed483aa9a4cdefefcef49006dff2a6835"}, + {file = "mypy-1.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:52825b01f5c4c1c4eb0db253ec09c7aa17e1a7304d247c48b6f3599ef40db8bd"}, + {file = "mypy-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f5ac9a4eeb1ec0f1ccdc6f326bcdb464de5f80eb07fb38b5ddd7b0de6bc61e55"}, + {file = "mypy-1.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afe3fe972c645b4632c563d3f3eff1cdca2fa058f730df2b93a35e3b0c538218"}, + {file = "mypy-1.8.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:42c6680d256ab35637ef88891c6bd02514ccb7e1122133ac96055ff458f93fc3"}, + {file = "mypy-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:720a5ca70e136b675af3af63db533c1c8c9181314d207568bbe79051f122669e"}, + {file = "mypy-1.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:028cf9f2cae89e202d7b6593cd98db6759379f17a319b5faf4f9978d7084cdc6"}, + {file = "mypy-1.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4e6d97288757e1ddba10dd9549ac27982e3e74a49d8d0179fc14d4365c7add66"}, + {file = "mypy-1.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f1478736fcebb90f97e40aff11a5f253af890c845ee0c850fe80aa060a267c6"}, + {file = "mypy-1.8.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42419861b43e6962a649068a61f4a4839205a3ef525b858377a960b9e2de6e0d"}, + {file = "mypy-1.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:2b5b6c721bd4aabaadead3a5e6fa85c11c6c795e0c81a7215776ef8afc66de02"}, + {file = "mypy-1.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5c1538c38584029352878a0466f03a8ee7547d7bd9f641f57a0f3017a7c905b8"}, + {file = "mypy-1.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4ef4be7baf08a203170f29e89d79064463b7fc7a0908b9d0d5114e8009c3a259"}, + {file = "mypy-1.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7178def594014aa6c35a8ff411cf37d682f428b3b5617ca79029d8ae72f5402b"}, + {file = "mypy-1.8.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ab3c84fa13c04aeeeabb2a7f67a25ef5d77ac9d6486ff33ded762ef353aa5592"}, + {file = "mypy-1.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:99b00bc72855812a60d253420d8a2eae839b0afa4938f09f4d2aa9bb4654263a"}, + {file = "mypy-1.8.0-py3-none-any.whl", hash = "sha256:538fd81bb5e430cc1381a443971c0475582ff9f434c16cd46d2c66763ce85d9d"}, + {file = "mypy-1.8.0.tar.gz", hash = "sha256:6ff8b244d7085a0b425b56d327b480c3b29cafbd2eff27316a004f9a7391ae07"}, ] [package.dependencies] -mypy-extensions = ">=0.4.3" +mypy-extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=3.10" +typing-extensions = ">=4.1.0" [package.extras] dmypy = ["psutil (>=4.0)"] install-types = ["pip"] -python2 = ["typed-ast (>=1.4.0,<2)"] +mypyc = ["setuptools (>=50)"] reports = ["lxml"] [[package]] name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -756,6 +788,7 @@ files = [ name = "packaging" version = "23.2" description = "Core utilities for Python packages" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -767,6 +800,7 @@ files = [ name = "pathspec" version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -778,6 +812,7 @@ files = [ name = "platformdirs" version = "4.1.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -793,6 +828,7 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-co name = "pluggy" version = "1.3.0" description = "plugin and hook calling mechanisms for python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -808,6 +844,7 @@ testing = ["pytest", "pytest-benchmark"] name = "ply" version = "3.11" description = "Python Lex & Yacc" +category = "dev" optional = false python-versions = "*" files = [ @@ -819,6 +856,7 @@ files = [ name = "pprintpp" version = "0.4.0" description = "A drop-in replacement for pprint that's actually pretty" +category = "dev" optional = false python-versions = "*" files = [ @@ -830,6 +868,7 @@ files = [ name = "pydantic" version = "2.5.3" description = "Data validation using Python type hints" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -850,6 +889,7 @@ email = ["email-validator (>=2.0.0)"] name = "pydantic-core" version = "2.14.6" description = "" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -967,6 +1007,7 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" name = "pygments" version = "2.17.2" description = "Pygments is a syntax highlighting package written in Python." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -982,6 +1023,7 @@ windows-terminal = ["colorama (>=0.4.6)"] name = "pyproject-hooks" version = "1.0.0" description = "Wrappers to call pyproject.toml-based build backend hooks." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -996,6 +1038,7 @@ tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} name = "pytest" version = "7.4.4" description = "pytest: simple powerful testing with Python" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1018,6 +1061,7 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no name = "pytest-clarity" version = "1.0.1" description = "A plugin providing an alternative, colourful diff output for failing assertions." +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1033,6 +1077,7 @@ rich = ">=8.0.0" name = "pytest-cov" version = "4.1.0" description = "Pytest plugin for measuring coverage." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1051,6 +1096,7 @@ testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtuale name = "pytest-sugar" version = "0.9.7" description = "pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly)." +category = "dev" optional = false python-versions = "*" files = [ @@ -1070,6 +1116,7 @@ dev = ["black", "flake8", "pre-commit"] name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1129,6 +1176,7 @@ files = [ name = "requests" version = "2.31.0" description = "Python HTTP for Humans." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1150,6 +1198,7 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "rich" version = "13.7.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" +category = "main" optional = false python-versions = ">=3.7.0" files = [ @@ -1169,6 +1218,7 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] name = "ruff" version = "0.1.11" description = "An extremely fast Python linter and code formatter, written in Rust." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1195,6 +1245,7 @@ files = [ name = "sniffio" version = "1.3.0" description = "Sniff out which async library your code is running under" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1206,6 +1257,7 @@ files = [ name = "termcolor" version = "2.4.0" description = "ANSI color formatting for output in terminal" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1220,6 +1272,7 @@ tests = ["pytest", "pytest-cov"] name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1231,6 +1284,7 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1242,6 +1296,7 @@ files = [ name = "types-pyyaml" version = "6.0.12.12" description = "Typing stubs for PyYAML" +category = "dev" optional = false python-versions = "*" files = [ @@ -1253,6 +1308,7 @@ files = [ name = "types-requests" version = "2.31.0.20240106" description = "Typing stubs for requests" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1267,6 +1323,7 @@ urllib3 = ">=2" name = "typing-extensions" version = "4.9.0" description = "Backported and Experimental Type Hints for Python 3.8+" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1278,6 +1335,7 @@ files = [ name = "typing-inspect" version = "0.9.0" description = "Runtime inspection utilities for typing module." +category = "main" optional = true python-versions = "*" files = [ @@ -1293,6 +1351,7 @@ typing-extensions = ">=3.7.4" name = "urllib3" version = "2.1.0" description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1309,6 +1368,7 @@ zstd = ["zstandard (>=0.18.0)"] name = "zipp" version = "3.17.0" description = "Backport of pathlib-compatible object wrapper for zip files" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1327,4 +1387,4 @@ yaml = ["pyyaml"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<4" -content-hash = "6b3760677982bb18f2409cf644f71b774aed3fecaf1e75e2ada8a7cac87d2534" +content-hash = "3cb8c0668aa44e57a211a4a03ffb59a7eabc29724aac7f03fe3160639c0f17c9" diff --git a/pyproject.toml b/pyproject.toml index 55c693312..5f37e3174 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ cli = ["cappa", "PyYAML"] [tool.poetry.group.dev.dependencies] pytest = "*" pytest-cov = "*" -mypy = "1.0.1" +mypy = "*" build = "*" ruff = "*" types-PyYAML = "*" @@ -81,6 +81,10 @@ check_untyped_defs = true no_implicit_optional = true strict_optional = false +plugins = [ + "pydantic.mypy" +] + [[tool.mypy.overrides]] module = "mypy-argo.workflows.*" @@ -138,6 +142,7 @@ src = ["src"] "src/hera/workflows/_unparse.py" = ["D"] "src/hera/workflows/models/**" = ["D"] "tests/**" = ["D"] +"scripts/graphlib.py" = ["D"] [tool.ruff.isort] force-wrap-aliases = true diff --git a/scripts/graphlib.py b/scripts/graphlib.py new file mode 100644 index 000000000..ca14836d3 --- /dev/null +++ b/scripts/graphlib.py @@ -0,0 +1,240 @@ +__all__ = ["TopologicalSorter", "CycleError"] + +_NODE_OUT = -1 +_NODE_DONE = -2 + + +class _NodeInfo: + __slots__ = "node", "npredecessors", "successors" + + def __init__(self, node): + # The node this class is augmenting. + self.node = node + + # Number of predecessors, generally >= 0. When this value falls to 0, + # and is returned by get_ready(), this is set to _NODE_OUT and when the + # node is marked done by a call to done(), set to _NODE_DONE. + self.npredecessors = 0 + + # List of successor nodes. The list can contain duplicated elements as + # long as they're all reflected in the successor's npredecessors attribute. + self.successors = [] + + +class CycleError(ValueError): + """Subclass of ValueError raised by TopologicalSorter.prepare if cycles + exist in the working graph. + + If multiple cycles exist, only one undefined choice among them will be reported + and included in the exception. The detected cycle can be accessed via the second + element in the *args* attribute of the exception instance and consists in a list + of nodes, such that each node is, in the graph, an immediate predecessor of the + next node in the list. In the reported list, the first and the last node will be + the same, to make it clear that it is cyclic. + """ + + pass + + +class TopologicalSorter: + """Provides functionality to topologically sort a graph of hashable nodes""" + + def __init__(self, graph=None): + self._node2info = {} + self._ready_nodes = None + self._npassedout = 0 + self._nfinished = 0 + + if graph is not None: + for node, predecessors in graph.items(): + self.add(node, *predecessors) + + def _get_nodeinfo(self, node): + if (result := self._node2info.get(node)) is None: + self._node2info[node] = result = _NodeInfo(node) + return result + + def add(self, node, *predecessors): + """Add a new node and its predecessors to the graph. + + Both the *node* and all elements in *predecessors* must be hashable. + + If called multiple times with the same node argument, the set of dependencies + will be the union of all dependencies passed in. + + It is possible to add a node with no dependencies (*predecessors* is not provided) + as well as provide a dependency twice. If a node that has not been provided before + is included among *predecessors* it will be automatically added to the graph with + no predecessors of its own. + + Raises ValueError if called after "prepare". + """ + if self._ready_nodes is not None: + raise ValueError("Nodes cannot be added after a call to prepare()") + + # Create the node -> predecessor edges + nodeinfo = self._get_nodeinfo(node) + nodeinfo.npredecessors += len(predecessors) + + # Create the predecessor -> node edges + for pred in predecessors: + pred_info = self._get_nodeinfo(pred) + pred_info.successors.append(node) + + def prepare(self): + """Mark the graph as finished and check for cycles in the graph. + + If any cycle is detected, "CycleError" will be raised, but "get_ready" can + still be used to obtain as many nodes as possible until cycles block more + progress. After a call to this function, the graph cannot be modified and + therefore no more nodes can be added using "add". + """ + if self._ready_nodes is not None: + raise ValueError("cannot prepare() more than once") + + self._ready_nodes = [i.node for i in self._node2info.values() if i.npredecessors == 0] + # ready_nodes is set before we look for cycles on purpose: + # if the user wants to catch the CycleError, that's fine, + # they can continue using the instance to grab as many + # nodes as possible before cycles block more progress + cycle = self._find_cycle() + if cycle: + raise CycleError("nodes are in a cycle", cycle) + + def get_ready(self): + """Return a tuple of all the nodes that are ready. + + Initially it returns all nodes with no predecessors; once those are marked + as processed by calling "done", further calls will return all new nodes that + have all their predecessors already processed. Once no more progress can be made, + empty tuples are returned. + + Raises ValueError if called without calling "prepare" previously. + """ + if self._ready_nodes is None: + raise ValueError("prepare() must be called first") + + # Get the nodes that are ready and mark them + result = tuple(self._ready_nodes) + n2i = self._node2info + for node in result: + n2i[node].npredecessors = _NODE_OUT + + # Clean the list of nodes that are ready and update + # the counter of nodes that we have returned. + self._ready_nodes.clear() + self._npassedout += len(result) + + return result + + def is_active(self): + """Return ``True`` if more progress can be made and ``False`` otherwise. + + Progress can be made if cycles do not block the resolution and either there + are still nodes ready that haven't yet been returned by "get_ready" or the + number of nodes marked "done" is less than the number that have been returned + by "get_ready". + + Raises ValueError if called without calling "prepare" previously. + """ + if self._ready_nodes is None: + raise ValueError("prepare() must be called first") + return self._nfinished < self._npassedout or bool(self._ready_nodes) + + def __bool__(self): + return self.is_active() + + def done(self, *nodes): + """Marks a set of nodes returned by "get_ready" as processed. + + This method unblocks any successor of each node in *nodes* for being returned + in the future by a call to "get_ready". + + Raises :exec:`ValueError` if any node in *nodes* has already been marked as + processed by a previous call to this method, if a node was not added to the + graph by using "add" or if called without calling "prepare" previously or if + node has not yet been returned by "get_ready". + """ + if self._ready_nodes is None: + raise ValueError("prepare() must be called first") + + n2i = self._node2info + + for node in nodes: + # Check if we know about this node (it was added previously using add() + if (nodeinfo := n2i.get(node)) is None: + raise ValueError(f"node {node!r} was not added using add()") + + # If the node has not being returned (marked as ready) previously, inform the user. + stat = nodeinfo.npredecessors + if stat != _NODE_OUT: + if stat >= 0: + raise ValueError(f"node {node!r} was not passed out (still not ready)") + elif stat == _NODE_DONE: + raise ValueError(f"node {node!r} was already marked done") + else: + assert False, f"node {node!r}: unknown status {stat}" + + # Mark the node as processed + nodeinfo.npredecessors = _NODE_DONE + + # Go to all the successors and reduce the number of predecessors, collecting all the ones + # that are ready to be returned in the next get_ready() call. + for successor in nodeinfo.successors: + successor_info = n2i[successor] + successor_info.npredecessors -= 1 + if successor_info.npredecessors == 0: + self._ready_nodes.append(successor) + self._nfinished += 1 + + def _find_cycle(self): + n2i = self._node2info + stack = [] + itstack = [] + seen = set() + node2stacki = {} + + for node in n2i: + if node in seen: + continue + + while True: + if node in seen: + # If we have seen already the node and is in the + # current stack we have found a cycle. + if node in node2stacki: + return stack[node2stacki[node] :] + [node] + # else go on to get next successor + else: + seen.add(node) + itstack.append(iter(n2i[node].successors).__next__) + node2stacki[node] = len(stack) + stack.append(node) + + # Backtrack to the topmost stack entry with + # at least another successor. + while stack: + try: + node = itstack[-1]() + break + except StopIteration: + del node2stacki[stack.pop()] + itstack.pop() + else: + break + return None + + def static_order(self): + """Returns an iterable of nodes in a topological order. + + The particular order that is returned may depend on the specific + order in which the items were inserted in the graph. + + Using this method does not require to call "prepare" or "done". If any + cycle is detected, :exc:`CycleError` will be raised. + """ + self.prepare() + while self.is_active(): + node_group = self.get_ready() + yield from node_group + self.done(*node_group) diff --git a/scripts/service.py b/scripts/service.py index 026eff4d2..ad9435ab2 100644 --- a/scripts/service.py +++ b/scripts/service.py @@ -167,7 +167,7 @@ def __str__(self) -> str: # return value if self.response.ref == "str": ret_val = "str(resp.content)" - elif "Response" in self.response.ref: + elif "Response" in self.response.ref and "InfoResponse" not in self.response.ref: ret_val = f"{self.response}()" else: ret_val = f"{self.response}(**resp.json())" diff --git a/scripts/spec.py b/scripts/spec.py index 4cd868587..e9528bc12 100755 --- a/scripts/spec.py +++ b/scripts/spec.py @@ -7,10 +7,16 @@ import requests +try: + from graphlib import TopologicalSorter +except ImportError: + from .graphlib import TopologicalSorter + logger: logging.Logger = logging.getLogger(__name__) # get the OpenAPI spec URI from the command line, along with the output file open_api_spec_url = sys.argv[1] + assert open_api_spec_url is not None, "Expected the OpenAPI spec URL to be passed as the first argument" output_file = sys.argv[2] @@ -133,10 +139,40 @@ "enum": ["Always", "Never", "IfNotPresent"], }, ), + ( + "io.k8s.apimachinery.pkg.util.intstr.IntOrString", + { + "type": ["string", "integer"], + }, + ), ] for obj_name, obj_spec in MANUAL_SPECIFICATIONS: spec["definitions"][obj_name] = obj_spec + +# Reorder spec topologically because pydantic only resolves forward refs to a certain depth (2 by default) +topo_sorter = TopologicalSorter() +prefix_len = len("#/definitions/") + +# Create "nodes" for the sorter from definition names and any "properties" that reference other definitions +for definition, metadata in spec["definitions"].items(): + if "properties" not in metadata: + topo_sorter.add(definition) + continue + + object_references = [] + for prop, attrs in metadata["properties"].items(): + if "$ref" in attrs: + object_references.append(attrs["$ref"][prefix_len:]) + topo_sorter.add(definition, *object_references) + +# Rebuild definitions as a new dictionary to maintain ordering +ordered_defs = {} +for definition in topo_sorter.static_order(): + ordered_defs[definition] = spec["definitions"][definition] + +spec["definitions"] = ordered_defs + # finally, we write the spec to the output file that is passed to use assuming the client wants to perform # something with this file with open(output_file, "w+") as f: diff --git a/src/hera/events/models/eventsource.py b/src/hera/events/models/eventsource.py index 590725380..ef39cc451 100644 --- a/src/hera/events/models/eventsource.py +++ b/src/hera/events/models/eventsource.py @@ -5,6 +5,8 @@ from typing import Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from .io.argoproj.events import v1alpha1 @@ -16,17 +18,18 @@ class EventSourceDeletedResponse(BaseModel): class LogEntry(BaseModel): - event_name: Optional[str] = Field( - default=None, - alias="eventName", - title="optional - the event name (e.g. `example`)", - ) - event_source_name: Optional[str] = Field(default=None, alias="eventSourceName") - event_source_type: Optional[str] = Field( - default=None, - alias="eventSourceType", - title="optional - the event source type (e.g. `webhook`)", - ) + event_name: Annotated[ + Optional[str], + Field(alias="eventName", title="optional - the event name (e.g. `example`)"), + ] = None + event_source_name: Annotated[Optional[str], Field(alias="eventSourceName")] = None + event_source_type: Annotated[ + Optional[str], + Field( + alias="eventSourceType", + title="optional - the event source type (e.g. `webhook`)", + ), + ] = None level: Optional[str] = None msg: Optional[str] = None namespace: Optional[str] = None @@ -34,7 +37,7 @@ class LogEntry(BaseModel): class CreateEventSourceRequest(BaseModel): - event_source: Optional[v1alpha1.EventSource] = Field(default=None, alias="eventSource") + event_source: Annotated[Optional[v1alpha1.EventSource], Field(alias="eventSource")] = None namespace: Optional[str] = None @@ -44,6 +47,6 @@ class EventSourceWatchEvent(BaseModel): class UpdateEventSourceRequest(BaseModel): - event_source: Optional[v1alpha1.EventSource] = Field(default=None, alias="eventSource") + event_source: Annotated[Optional[v1alpha1.EventSource], Field(alias="eventSource")] = None name: Optional[str] = None namespace: Optional[str] = None diff --git a/src/hera/events/models/io/argoproj/events/v1alpha1.py b/src/hera/events/models/io/argoproj/events/v1alpha1.py index 5f31f1388..164115823 100644 --- a/src/hera/events/models/io/argoproj/events/v1alpha1.py +++ b/src/hera/events/models/io/argoproj/events/v1alpha1.py @@ -5,289 +5,385 @@ from typing import Dict, List, Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field -from ...k8s.api.core import v1 -from ...k8s.apimachinery.pkg.apis.meta import v1 as v1_1 +from ...k8s.api.core import v1 as v1_1 +from ...k8s.apimachinery.pkg.apis.meta import v1 class AMQPConsumeConfig(BaseModel): - auto_ack: Optional[bool] = Field( - default=None, - alias="autoAck", - title=( - "AutoAck when true, the server will acknowledge deliveries to this consumer" - " prior to writing\nthe delivery to the network\n+optional" - ), - ) - consumer_tag: Optional[str] = Field( - default=None, - alias="consumerTag", - title=("ConsumerTag is the identity of the consumer included in every" " delivery\n+optional"), - ) - exclusive: Optional[bool] = Field( - default=None, - title=( - "Exclusive when true, the server will ensure that this is the sole consumer" " from this queue\n+optional" - ), - ) - no_local: Optional[bool] = Field( - default=None, - alias="noLocal", - title="NoLocal flag is not supported by RabbitMQ\n+optional", - ) - no_wait: Optional[bool] = Field( - default=None, - alias="noWait", - title=( - "NowWait when true, do not wait for the server to confirm the request and" - " immediately begin deliveries\n+optional" - ), - ) + auto_ack: Annotated[ + Optional[bool], + Field( + alias="autoAck", + title=( + "AutoAck when true, the server will acknowledge deliveries to this" + " consumer prior to writing\nthe delivery to the network\n+optional" + ), + ), + ] = None + consumer_tag: Annotated[ + Optional[str], + Field( + alias="consumerTag", + title=("ConsumerTag is the identity of the consumer included in every" " delivery\n+optional"), + ), + ] = None + exclusive: Annotated[ + Optional[bool], + Field( + title=( + "Exclusive when true, the server will ensure that this is the sole" + " consumer from this queue\n+optional" + ) + ), + ] = None + no_local: Annotated[ + Optional[bool], + Field( + alias="noLocal", + title="NoLocal flag is not supported by RabbitMQ\n+optional", + ), + ] = None + no_wait: Annotated[ + Optional[bool], + Field( + alias="noWait", + title=( + "NowWait when true, do not wait for the server to confirm the request" + " and immediately begin deliveries\n+optional" + ), + ), + ] = None class AMQPExchangeDeclareConfig(BaseModel): - auto_delete: Optional[bool] = Field( - default=None, - alias="autoDelete", - title="AutoDelete removes the exchange when no bindings are active\n+optional", - ) - durable: Optional[bool] = Field( - default=None, - title="Durable keeps the exchange also after the server restarts\n+optional", - ) - internal: Optional[bool] = Field(default=None, title="Internal when true does not accept publishings\n+optional") - no_wait: Optional[bool] = Field( - default=None, - alias="noWait", - title=("NowWait when true does not wait for a confirmation from the" " server\n+optional"), - ) + auto_delete: Annotated[ + Optional[bool], + Field( + alias="autoDelete", + title=("AutoDelete removes the exchange when no bindings are active\n+optional"), + ), + ] = None + durable: Annotated[ + Optional[bool], + Field(title="Durable keeps the exchange also after the server restarts\n+optional"), + ] = None + internal: Annotated[ + Optional[bool], + Field(title="Internal when true does not accept publishings\n+optional"), + ] = None + no_wait: Annotated[ + Optional[bool], + Field( + alias="noWait", + title=("NowWait when true does not wait for a confirmation from the" " server\n+optional"), + ), + ] = None + + +class EventSourceFilter(BaseModel): + expression: Optional[str] = None class AMQPQueueBindConfig(BaseModel): - no_wait: Optional[bool] = Field( - default=None, - alias="noWait", - title=( - "NowWait false and the queue could not be bound, the channel will be closed" " with an error\n+optional" + no_wait: Annotated[ + Optional[bool], + Field( + alias="noWait", + title=( + "NowWait false and the queue could not be bound, the channel will be" + " closed with an error\n+optional" + ), ), - ) + ] = None class AMQPQueueDeclareConfig(BaseModel): - arguments: Optional[str] = Field( - default=None, - title=( - 'Arguments of a queue (also known as "x-arguments") used for optional' " features and plugins\n+optional" - ), - ) - auto_delete: Optional[bool] = Field( - default=None, - alias="autoDelete", - title="AutoDelete removes the queue when no consumers are active\n+optional", - ) - durable: Optional[bool] = Field( - default=None, - title="Durable keeps the queue also after the server restarts\n+optional", - ) - exclusive: Optional[bool] = Field( - default=None, - title=( - "Exclusive sets the queues to be accessible only by the connection that" - " declares them and will be\ndeleted wgen the connection closes\n+optional" - ), - ) - name: Optional[str] = Field( - default=None, - title=("Name of the queue. If empty the server auto-generates a unique name for" " this queue\n+optional"), - ) - no_wait: Optional[bool] = Field( - default=None, - alias="noWait", - title=("NowWait when true, the queue assumes to be declared on the" " server\n+optional"), - ) + arguments: Annotated[ + Optional[str], + Field( + title=( + 'Arguments of a queue (also known as "x-arguments") used for optional' + " features and plugins\n+optional" + ) + ), + ] = None + auto_delete: Annotated[ + Optional[bool], + Field( + alias="autoDelete", + title=("AutoDelete removes the queue when no consumers are active\n+optional"), + ), + ] = None + durable: Annotated[ + Optional[bool], + Field(title="Durable keeps the queue also after the server restarts\n+optional"), + ] = None + exclusive: Annotated[ + Optional[bool], + Field( + title=( + "Exclusive sets the queues to be accessible only by the connection that" + " declares them and will be\ndeleted wgen the connection" + " closes\n+optional" + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + title=("Name of the queue. If empty the server auto-generates a unique name" " for this queue\n+optional") + ), + ] = None + no_wait: Annotated[ + Optional[bool], + Field( + alias="noWait", + title=("NowWait when true, the queue assumes to be declared on the" " server\n+optional"), + ), + ] = None class Amount(BaseModel): value: Optional[str] = None +class FileArtifact(BaseModel): + path: Optional[str] = None + + +class Resource(BaseModel): + value: Optional[str] = None + + +class URLArtifact(BaseModel): + path: Annotated[Optional[str], Field(title="Path is the complete URL")] = None + verify_cert: Annotated[ + Optional[bool], + Field( + alias="verifyCert", + title="VerifyCert decides whether the connection is secure or not", + ), + ] = None + + +class Int64OrString(BaseModel): + int64_val: Annotated[Optional[str], Field(alias="int64Val")] = None + str_val: Annotated[Optional[str], Field(alias="strVal")] = None + type: Optional[str] = None + + class BitbucketRepository(BaseModel): - owner: Optional[str] = Field(default=None, title="Owner is the owner of the repository") - repository_slug: Optional[str] = Field( - default=None, - alias="repositorySlug", - title=( - "RepositorySlug is a URL-friendly version of a repository name," - " automatically generated by Bitbucket for use in the URL" + owner: Annotated[Optional[str], Field(title="Owner is the owner of the repository")] = None + repository_slug: Annotated[ + Optional[str], + Field( + alias="repositorySlug", + title=( + "RepositorySlug is a URL-friendly version of a repository name," + " automatically generated by Bitbucket for use in the URL" + ), ), - ) + ] = None class BitbucketServerRepository(BaseModel): - project_key: Optional[str] = Field( - default=None, - alias="projectKey", - title="ProjectKey is the key of project for which integration needs to set up", - ) - repository_slug: Optional[str] = Field( - default=None, - alias="repositorySlug", - title=("RepositorySlug is the slug of the repository for which integration needs" " to set up"), - ) + project_key: Annotated[ + Optional[str], + Field( + alias="projectKey", + title=("ProjectKey is the key of project for which integration needs to set up"), + ), + ] = None + repository_slug: Annotated[ + Optional[str], + Field( + alias="repositorySlug", + title=("RepositorySlug is the slug of the repository for which integration" " needs to set up"), + ), + ] = None class CatchupConfiguration(BaseModel): - enabled: Optional[bool] = Field( - default=None, - title=("Enabled enables to triggered the missed schedule when eventsource restarts"), - ) - max_duration: Optional[str] = Field( - default=None, - alias="maxDuration", - title="MaxDuration holds max catchup duration", - ) + enabled: Annotated[ + Optional[bool], + Field(title=("Enabled enables to triggered the missed schedule when eventsource" " restarts")), + ] = None + max_duration: Annotated[ + Optional[str], + Field(alias="maxDuration", title="MaxDuration holds max catchup duration"), + ] = None class ConditionsResetByTime(BaseModel): - cron: Optional[str] = Field( - default=None, - title=("Cron is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron"), - ) - timezone: Optional[str] = Field(default=None, title="+optional") - - -class ConditionsResetCriteria(BaseModel): - by_time: Optional[ConditionsResetByTime] = Field( - default=None, - alias="byTime", - title=("Schedule is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron"), - ) + cron: Annotated[ + Optional[str], + Field(title=("Cron is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron")), + ] = None + timezone: Annotated[Optional[str], Field(title="+optional")] = None class ConfigMapPersistence(BaseModel): - create_if_not_exist: Optional[bool] = Field( - default=None, - alias="createIfNotExist", - title="CreateIfNotExist will create configmap if it doesn't exists", - ) - name: Optional[str] = Field(default=None, title="Name of the configmap") + create_if_not_exist: Annotated[ + Optional[bool], + Field( + alias="createIfNotExist", + title="CreateIfNotExist will create configmap if it doesn't exists", + ), + ] = None + name: Annotated[Optional[str], Field(title="Name of the configmap")] = None class DataFilter(BaseModel): - comparator: Optional[str] = Field( - default=None, - description=( - 'Comparator compares the event data with a user given value.\nCan be ">=",' - ' ">", "=", "!=", "<", or "<=".\nIs optional, and if left blank treated as' - ' equality "=".' - ), - ) - path: Optional[str] = Field( - default=None, - description=( - "Path is the JSONPath of the event's (JSON decoded) data key\nPath is a" - " series of keys separated by a dot. A key may contain wildcard characters" - " '*' and '?'.\nTo access an array value use the index as the key. The dot" - " and wildcard characters can be escaped with '\\\\'.\nSee" - " https://github.com/tidwall/gjson#path-syntax for more information on how" - " to use this." - ), - ) - template: Optional[str] = Field( - default=None, - title=( - "Template is a go-template for extracting a string from the event's" - " data.\nA Template is evaluated with provided path, type and value.\nThe" - " templating follows the standard go-template syntax as well as sprig's" - " extra functions.\nSee https://pkg.go.dev/text/template and" - " https://masterminds.github.io/sprig/" - ), - ) - type: Optional[str] = Field(default=None, title="Type contains the JSON type of the data") - value: Optional[List[str]] = Field( - default=None, - title=( - "Value is the allowed string values for this key\nBooleans are passed using" - " strconv.ParseBool()\nNumbers are parsed using as float64 using" - " strconv.ParseFloat()\nStrings are taken as is\nNils this value is ignored" - ), - ) + comparator: Annotated[ + Optional[str], + Field( + description=( + "Comparator compares the event data with a user given value.\nCan be" + ' ">=", ">", "=", "!=", "<", or "<=".\nIs optional, and if left blank' + ' treated as equality "=".' + ) + ), + ] = None + path: Annotated[ + Optional[str], + Field( + description=( + "Path is the JSONPath of the event's (JSON decoded) data key\nPath is a" + " series of keys separated by a dot. A key may contain wildcard" + " characters '*' and '?'.\nTo access an array value use the index as" + " the key. The dot and wildcard characters can be escaped with" + " '\\\\'.\nSee https://github.com/tidwall/gjson#path-syntax for more" + " information on how to use this." + ) + ), + ] = None + template: Annotated[ + Optional[str], + Field( + title=( + "Template is a go-template for extracting a string from the event's" + " data.\nA Template is evaluated with provided path, type and" + " value.\nThe templating follows the standard go-template syntax as" + " well as sprig's extra functions.\nSee" + " https://pkg.go.dev/text/template and" + " https://masterminds.github.io/sprig/" + ) + ), + ] = None + type: Annotated[Optional[str], Field(title="Type contains the JSON type of the data")] = None + value: Annotated[ + Optional[List[str]], + Field( + title=( + "Value is the allowed string values for this key\nBooleans are passed" + " using strconv.ParseBool()\nNumbers are parsed using as float64 using" + " strconv.ParseFloat()\nStrings are taken as is\nNils this value is" + " ignored" + ) + ), + ] = None class EventDependencyTransformer(BaseModel): - jq: Optional[str] = Field( - default=None, - title="JQ holds the jq command applied for transformation\n+optional", - ) - script: Optional[str] = Field( - default=None, - title="Script refers to a Lua script used to transform the event\n+optional", - ) - + jq: Annotated[ + Optional[str], + Field(title="JQ holds the jq command applied for transformation\n+optional"), + ] = None + script: Annotated[ + Optional[str], + Field(title="Script refers to a Lua script used to transform the event\n+optional"), + ] = None -class EventPersistence(BaseModel): - catchup: Optional[CatchupConfiguration] = Field( - default=None, - title=("Catchup enables to triggered the missed schedule when eventsource restarts"), - ) - config_map: Optional[ConfigMapPersistence] = Field( - default=None, - alias="configMap", - title="ConfigMap holds configmap details for persistence", - ) - -class EventSourceFilter(BaseModel): - expression: Optional[str] = None +class TimeFilter(BaseModel): + start: Annotated[ + Optional[str], + Field( + description=( + "Start is the beginning of a time window in UTC.\nBefore this time," + " events for this dependency are ignored.\nFormat is hh:mm:ss." + ) + ), + ] = None + stop: Annotated[ + Optional[str], + Field( + description=( + "Stop is the end of a time window in UTC.\nAfter or equal to this time," + " events for this dependency are ignored and\nFormat is hh:mm:ss.\nIf" + " it is smaller than Start, it is treated as next day of Start\n(e.g.:" + " 22:00:00-01:00:00 means 22:00:00-25:00:00)." + ) + ), + ] = None -class FileArtifact(BaseModel): - path: Optional[str] = None +class WatchPathConfig(BaseModel): + directory: Annotated[Optional[str], Field(title="Directory to watch for events")] = None + path: Annotated[ + Optional[str], + Field(title=("Path is relative path of object to watch with respect to the directory")), + ] = None + path_regexp: Annotated[ + Optional[str], + Field( + alias="pathRegexp", + title=("PathRegexp is regexp of relative path of object to watch with respect" " to the directory"), + ), + ] = None class GitRemoteConfig(BaseModel): - name: Optional[str] = Field(default=None, description="Name of the remote to fetch from.") - urls: Optional[List[str]] = Field( - default=None, - description=( - "URLs the URLs of a remote repository. It must be non-empty. Fetch" - " will\nalways use the first URL, while push will use all of them." + name: Annotated[Optional[str], Field(description="Name of the remote to fetch from.")] = None + urls: Annotated[ + Optional[List[str]], + Field( + description=( + "URLs the URLs of a remote repository. It must be non-empty. Fetch" + " will\nalways use the first URL, while push will use all of them." + ) ), - ) - - -class Int64OrString(BaseModel): - int64_val: Optional[str] = Field(default=None, alias="int64Val") - str_val: Optional[str] = Field(default=None, alias="strVal") - type: Optional[str] = None + ] = None class KafkaConsumerGroup(BaseModel): - group_name: Optional[str] = Field(default=None, alias="groupName", title="The name for the consumer group to use") - oldest: Optional[bool] = Field( - default=None, - title=( - "When starting up a new group do we want to start from the oldest event" - " (true) or the newest event (false), defaults to false\n+optional" - ), - ) - rebalance_strategy: Optional[str] = Field( - default=None, - alias="rebalanceStrategy", - title=("Rebalance strategy can be one of: sticky, roundrobin, range. Range is the" " default.\n+optional"), - ) + group_name: Annotated[ + Optional[str], + Field(alias="groupName", title="The name for the consumer group to use"), + ] = None + oldest: Annotated[ + Optional[bool], + Field( + title=( + "When starting up a new group do we want to start from the oldest event" + " (true) or the newest event (false), defaults to false\n+optional" + ) + ), + ] = None + rebalance_strategy: Annotated[ + Optional[str], + Field( + alias="rebalanceStrategy", + title=("Rebalance strategy can be one of: sticky, roundrobin, range. Range is" " the default.\n+optional"), + ), + ] = None class LogTrigger(BaseModel): - interval_seconds: Optional[str] = Field( - default=None, - alias="intervalSeconds", - title=( - "Only print messages every interval. Useful to prevent logging too much" - " data for busy events.\n+optional" + interval_seconds: Annotated[ + Optional[str], + Field( + alias="intervalSeconds", + title=( + "Only print messages every interval. Useful to prevent logging too much" + " data for busy events.\n+optional" + ), ), - ) + ] = None class Metadata(BaseModel): @@ -296,32 +392,33 @@ class Metadata(BaseModel): class OwnedRepositories(BaseModel): - names: Optional[List[str]] = Field(default=None, title="Repository names") - owner: Optional[str] = Field(default=None, title="Organization or user name") + names: Annotated[Optional[List[str]], Field(title="Repository names")] = None + owner: Annotated[Optional[str], Field(title="Organization or user name")] = None class PayloadField(BaseModel): - name: Optional[str] = Field(default=None, description="Name acts as key that holds the value at the path.") - path: Optional[str] = Field( - default=None, - description=( - "Path is the JSONPath of the event's (JSON decoded) data key\nPath is a" - " series of keys separated by a dot. A key may contain wildcard characters" - " '*' and '?'.\nTo access an array value use the index as the key. The dot" - " and wildcard characters can be escaped with '\\\\'.\nSee" - " https://github.com/tidwall/gjson#path-syntax for more information on how" - " to use this." - ), - ) + name: Annotated[ + Optional[str], + Field(description="Name acts as key that holds the value at the path."), + ] = None + path: Annotated[ + Optional[str], + Field( + description=( + "Path is the JSONPath of the event's (JSON decoded) data key\nPath is a" + " series of keys separated by a dot. A key may contain wildcard" + " characters '*' and '?'.\nTo access an array value use the index as" + " the key. The dot and wildcard characters can be escaped with" + " '\\\\'.\nSee https://github.com/tidwall/gjson#path-syntax for more" + " information on how to use this." + ) + ), + ] = None class RateLimit(BaseModel): - requests_per_unit: Optional[int] = Field(default=None, alias="requestsPerUnit") - unit: Optional[str] = Field(default=None, title="Defaults to Second") - - -class Resource(BaseModel): - value: Optional[str] = None + requests_per_unit: Annotated[Optional[int], Field(alias="requestsPerUnit")] = None + unit: Annotated[Optional[str], Field(title="Defaults to Second")] = None class S3Bucket(BaseModel): @@ -335,16 +432,18 @@ class S3Filter(BaseModel): class Selector(BaseModel): - key: Optional[str] = Field(default=None, title="Key name") - operation: Optional[str] = Field( - default=None, - title=( - "Supported operations like ==, !=, <=, >= etc.\nDefaults to ==.\nRefer" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" - " for more io.argoproj.workflow.v1alpha1.\n+optional" + key: Annotated[Optional[str], Field(title="Key name")] = None + operation: Annotated[ + Optional[str], + Field( + title=( + "Supported operations like ==, !=, <=, >= etc.\nDefaults to ==.\nRefer" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" + " for more io.argoproj.workflow.v1alpha1.\n+optional" + ) ), - ) - value: Optional[str] = Field(default=None, title="Value") + ] = None + value: Annotated[Optional[str], Field(title="Value")] = None class StatusPolicy(BaseModel): @@ -356,523 +455,784 @@ class StorageGridFilter(BaseModel): suffix: Optional[str] = None -class TimeFilter(BaseModel): - start: Optional[str] = Field( - default=None, - description=( - "Start is the beginning of a time window in UTC.\nBefore this time, events" - " for this dependency are ignored.\nFormat is hh:mm:ss." - ), - ) - stop: Optional[str] = Field( - default=None, - description=( - "Stop is the end of a time window in UTC.\nAfter or equal to this time," - " events for this dependency are ignored and\nFormat is hh:mm:ss.\nIf it is" - " smaller than Start, it is treated as next day of Start\n(e.g.:" - " 22:00:00-01:00:00 means 22:00:00-25:00:00)." - ), - ) - - class TriggerParameterSource(BaseModel): - context_key: Optional[str] = Field( - default=None, - alias="contextKey", - description=( - "ContextKey is the JSONPath of the event's (JSON decoded) context" - " key\nContextKey is a series of keys separated by a dot. A key may contain" - " wildcard characters '*' and '?'.\nTo access an array value use the index" - " as the key. The dot and wildcard characters can be escaped with" - " '\\\\'.\nSee https://github.com/tidwall/gjson#path-syntax for more" - " information on how to use this." - ), - ) - context_template: Optional[str] = Field( - default=None, - alias="contextTemplate", - title=( - "ContextTemplate is a go-template for extracting a string from the event's" - " context.\nIf a ContextTemplate is provided with a ContextKey, the" - " template will be evaluated first and fallback to the ContextKey.\nThe" - " templating follows the standard go-template syntax as well as sprig's" - " extra functions.\nSee https://pkg.go.dev/text/template and" - " https://masterminds.github.io/sprig/" - ), - ) - data_key: Optional[str] = Field( - default=None, - alias="dataKey", - description=( - "DataKey is the JSONPath of the event's (JSON decoded) data key\nDataKey is" - " a series of keys separated by a dot. A key may contain wildcard" - " characters '*' and '?'.\nTo access an array value use the index as the" - " key. The dot and wildcard characters can be escaped with '\\\\'.\nSee" - " https://github.com/tidwall/gjson#path-syntax for more information on how" - " to use this." - ), - ) - data_template: Optional[str] = Field( - default=None, - alias="dataTemplate", - title=( - "DataTemplate is a go-template for extracting a string from the event's" - " data.\nIf a DataTemplate is provided with a DataKey, the template will be" - " evaluated first and fallback to the DataKey.\nThe templating follows the" - " standard go-template syntax as well as sprig's extra functions.\nSee" - " https://pkg.go.dev/text/template and https://masterminds.github.io/sprig/" - ), - ) - dependency_name: Optional[str] = Field( - default=None, - alias="dependencyName", - description=( - "DependencyName refers to the name of the dependency. The event which is" - " stored for this dependency is used as payload\nfor the parameterization." - " Make sure to refer to one of the dependencies you have defined under" - " Dependencies list." - ), - ) - value: Optional[str] = Field( - default=None, - description=( - "Value is the default literal value to use for this parameter source\nThis" - " is only used if the DataKey is invalid.\nIf the DataKey is invalid and" - " this is not defined, this param source will produce an error." - ), - ) + context_key: Annotated[ + Optional[str], + Field( + alias="contextKey", + description=( + "ContextKey is the JSONPath of the event's (JSON decoded) context" + " key\nContextKey is a series of keys separated by a dot. A key may" + " contain wildcard characters '*' and '?'.\nTo access an array value" + " use the index as the key. The dot and wildcard characters can be" + " escaped with '\\\\'.\nSee" + " https://github.com/tidwall/gjson#path-syntax for more information on" + " how to use this." + ), + ), + ] = None + context_template: Annotated[ + Optional[str], + Field( + alias="contextTemplate", + title=( + "ContextTemplate is a go-template for extracting a string from the" + " event's context.\nIf a ContextTemplate is provided with a ContextKey," + " the template will be evaluated first and fallback to the" + " ContextKey.\nThe templating follows the standard go-template syntax" + " as well as sprig's extra functions.\nSee" + " https://pkg.go.dev/text/template and" + " https://masterminds.github.io/sprig/" + ), + ), + ] = None + data_key: Annotated[ + Optional[str], + Field( + alias="dataKey", + description=( + "DataKey is the JSONPath of the event's (JSON decoded) data" + " key\nDataKey is a series of keys separated by a dot. A key may" + " contain wildcard characters '*' and '?'.\nTo access an array value" + " use the index as the key. The dot and wildcard characters can be" + " escaped with '\\\\'.\nSee" + " https://github.com/tidwall/gjson#path-syntax for more information on" + " how to use this." + ), + ), + ] = None + data_template: Annotated[ + Optional[str], + Field( + alias="dataTemplate", + title=( + "DataTemplate is a go-template for extracting a string from the event's" + " data.\nIf a DataTemplate is provided with a DataKey, the template" + " will be evaluated first and fallback to the DataKey.\nThe templating" + " follows the standard go-template syntax as well as sprig's extra" + " functions.\nSee https://pkg.go.dev/text/template and" + " https://masterminds.github.io/sprig/" + ), + ), + ] = None + dependency_name: Annotated[ + Optional[str], + Field( + alias="dependencyName", + description=( + "DependencyName refers to the name of the dependency. The event which" + " is stored for this dependency is used as payload\nfor the" + " parameterization. Make sure to refer to one of the dependencies you" + " have defined under Dependencies list." + ), + ), + ] = None + value: Annotated[ + Optional[str], + Field( + description=( + "Value is the default literal value to use for this parameter" + " source\nThis is only used if the DataKey is invalid.\nIf the DataKey" + " is invalid and this is not defined, this param source will produce an" + " error." + ) + ), + ] = None -class URLArtifact(BaseModel): - path: Optional[str] = Field(default=None, title="Path is the complete URL") - verify_cert: Optional[bool] = Field( - default=None, - alias="verifyCert", - title="VerifyCert decides whether the connection is secure or not", - ) +class Condition(BaseModel): + last_transition_time: Annotated[ + Optional[v1.Time], + Field( + alias="lastTransitionTime", + title=("Last time the condition transitioned from one status to" " another.\n+optional"), + ), + ] = None + message: Annotated[ + Optional[str], + Field(title=("Human-readable message indicating details about last" " transition.\n+optional")), + ] = None + reason: Annotated[ + Optional[str], + Field( + title=( + "Unique, this should be a short, machine understandable string that" + " gives the reason\nfor condition's last transition. For example," + ' "ImageNotFound"\n+optional' + ) + ), + ] = None + status: Annotated[ + Optional[str], + Field(title="Condition status, True, False or Unknown.\n+required"), + ] = None + type: Annotated[Optional[str], Field(title="Condition type.\n+required")] = None -class WatchPathConfig(BaseModel): - directory: Optional[str] = Field(default=None, title="Directory to watch for events") - path: Optional[str] = Field( - default=None, - title="Path is relative path of object to watch with respect to the directory", - ) - path_regexp: Optional[str] = Field( - default=None, - alias="pathRegexp", - title=("PathRegexp is regexp of relative path of object to watch with respect to" " the directory"), - ) +class EventContext(BaseModel): + datacontenttype: Annotated[ + Optional[str], + Field(description=("DataContentType - A MIME (RFC2046) string describing the media type of" " `data`.")), + ] = None + id: Annotated[ + Optional[str], + Field(description=("ID of the event; must be non-empty and unique within the scope of the" " producer.")), + ] = None + source: Annotated[ + Optional[str], + Field(description="Source - A URI describing the event producer."), + ] = None + specversion: Annotated[ + Optional[str], + Field( + description=( + "SpecVersion - The version of the CloudEvents specification used by the" + " io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + subject: Annotated[ + Optional[str], + Field(title=("Subject - The subject of the event in the context of the event" " producer")), + ] = None + time: Annotated[ + Optional[v1.Time], + Field(description="Time - A Timestamp when the event happened."), + ] = None + type: Annotated[ + Optional[str], + Field(description="Type - The type of the occurrence which has happened."), + ] = None -class AzureEventsHubEventSource(BaseModel): - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - fqdn: Optional[str] = Field( - default=None, - title=( - "FQDN of the EventHubs namespace you created\nMore info at" - " https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string" - ), - ) - hub_name: Optional[str] = Field(default=None, alias="hubName", title="Event Hub path/name") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - shared_access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sharedAccessKey", - title="SharedAccessKey is the generated value of the key", - ) - shared_access_key_name: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sharedAccessKeyName", - title=("SharedAccessKeyName is the name you chose for your application's SAS keys"), - ) +class ResourceFilter(BaseModel): + after_start: Annotated[ + Optional[bool], + Field( + alias="afterStart", + title=( + "If the resource is created after the start time then the event is" " treated as valid.\n+optional" + ), + ), + ] = None + created_by: Annotated[ + Optional[v1.Time], + Field( + alias="createdBy", + title=( + "If resource is created before the specified time then the event is" " treated as valid.\n+optional" + ), + ), + ] = None + fields: Annotated[ + Optional[List[Selector]], + Field( + title=( + "Fields provide field filters similar to K8s field selector\n(see" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/).\nUnlike" + " K8s field selector, it supports arbitrary fileds like" + ' "spec.serviceAccountName",\nand the value could be a string or a' + ' regex.\nSame as K8s field selector, operator "=", "==" and "!=" are' + " supported.\n+optional" + ) + ), + ] = None + labels: Annotated[ + Optional[List[Selector]], + Field( + title=( + "Labels provide listing options to K8s API to watch resource/s.\nRefer" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/label-selectors/" + " for more io.argoproj.workflow.v1alpha1.\n+optional" + ) + ), + ] = None + prefix: Annotated[ + Optional[str], + Field(title="Prefix filter is applied on the resource name.\n+optional"), + ] = None -class Backoff(BaseModel): - duration: Optional[Int64OrString] = Field( - default=None, - title=('The initial duration in nanoseconds or strings like "1s", "3m"\n+optional'), - ) - factor: Optional[Amount] = Field(default=None, title="Duration is multiplied by factor each iteration\n+optional") - jitter: Optional[Amount] = Field(default=None, title="The amount of jitter applied each iteration\n+optional") - steps: Optional[int] = Field(default=None, title="Exit with error after this many steps\n+optional") +class AzureEventsHubEventSource(BaseModel): + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + fqdn: Annotated[ + Optional[str], + Field( + title=( + "FQDN of the EventHubs namespace you created\nMore info at" + " https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string" + ) + ), + ] = None + hub_name: Annotated[Optional[str], Field(alias="hubName", title="Event Hub path/name")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + shared_access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sharedAccessKey", + title="SharedAccessKey is the generated value of the key", + ), + ] = None + shared_access_key_name: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sharedAccessKeyName", + title=("SharedAccessKeyName is the name you chose for your application's SAS" " keys"), + ), + ] = None class BasicAuth(BaseModel): - password: Optional[v1.SecretKeySelector] = Field( - default=None, - description=("Password refers to the Kubernetes secret that holds the password required" " for basic auth."), - ) - username: Optional[v1.SecretKeySelector] = Field( - default=None, - description=("Username refers to the Kubernetes secret that holds the username required" " for basic auth."), - ) + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + description=( + "Password refers to the Kubernetes secret that holds the password" " required for basic auth." + ) + ), + ] = None + username: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + description=( + "Username refers to the Kubernetes secret that holds the username" " required for basic auth." + ) + ), + ] = None class BitbucketBasicAuth(BaseModel): - password: Optional[v1.SecretKeySelector] = Field( - default=None, - description="Password refers to the K8s secret that holds the password.", - ) - username: Optional[v1.SecretKeySelector] = Field( - default=None, - description="Username refers to the K8s secret that holds the username.", - ) + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(description="Password refers to the K8s secret that holds the password."), + ] = None + username: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(description="Username refers to the K8s secret that holds the username."), + ] = None -class CalendarEventSource(BaseModel): - exclusion_dates: Optional[List[str]] = Field( - default=None, - alias="exclusionDates", - description=("ExclusionDates defines the list of DATE-TIME exceptions for recurring" " events."), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - interval: Optional[str] = Field( - default=None, - title=("Interval is a string that describes an interval duration, e.g. 1s, 30m," " 2h...\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - persistence: Optional[EventPersistence] = Field( - default=None, title="Persistence hold the configuration for event persistence" - ) - schedule: Optional[str] = Field( - default=None, - title=( - "Schedule is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron\n+optional" - ), - ) - timezone: Optional[str] = Field(default=None, title="Timezone in which to run the schedule\n+optional") +class GenericEventSource(BaseModel): + auth_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="authSecret", + title=("AuthSecret holds a secret selector that contains a bearer token for" " authentication\n+optional"), + ), + ] = None + config: Annotated[Optional[str], Field(title="Config is the event source configuration")] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + insecure: Annotated[Optional[bool], Field(description="Insecure determines the type of connection.")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + url: Annotated[ + Optional[str], + Field(description="URL of the gRPC server that implements the event source."), + ] = None -class Condition(BaseModel): - last_transition_time: Optional[v1_1.Time] = Field( - default=None, - alias="lastTransitionTime", - title=("Last time the condition transitioned from one status to" " another.\n+optional"), - ) - message: Optional[str] = Field( - default=None, - title=("Human-readable message indicating details about last" " transition.\n+optional"), - ) - reason: Optional[str] = Field( - default=None, - title=( - "Unique, this should be a short, machine understandable string that gives" - " the reason\nfor condition's last transition. For example," - ' "ImageNotFound"\n+optional' - ), - ) - status: Optional[str] = Field(default=None, title="Condition status, True, False or Unknown.\n+required") - type: Optional[str] = Field(default=None, title="Condition type.\n+required") +class GitCreds(BaseModel): + password: Optional[v1_1.SecretKeySelector] = None + username: Optional[v1_1.SecretKeySelector] = None -class EventContext(BaseModel): - datacontenttype: Optional[str] = Field( - default=None, - description=("DataContentType - A MIME (RFC2046) string describing the media type of" " `data`."), - ) - id: Optional[str] = Field( - default=None, - description=("ID of the event; must be non-empty and unique within the scope of the" " producer."), - ) - source: Optional[str] = Field(default=None, description="Source - A URI describing the event producer.") - specversion: Optional[str] = Field( - default=None, - description=( - "SpecVersion - The version of the CloudEvents specification used by the" " io.argoproj.workflow.v1alpha1." - ), - ) - subject: Optional[str] = Field( - default=None, - title="Subject - The subject of the event in the context of the event producer", - ) - time: Optional[v1_1.Time] = Field(default=None, description="Time - A Timestamp when the event happened.") - type: Optional[str] = Field( - default=None, - description="Type - The type of the occurrence which has happened.", - ) +class GithubAppCreds(BaseModel): + app_id: Annotated[ + Optional[str], + Field( + alias="appID", + title="AppID refers to the GitHub App ID for the application you created", + ), + ] = None + installation_id: Annotated[ + Optional[str], + Field( + alias="installationID", + title=("InstallationID refers to the Installation ID of the GitHub app you" " created and installed"), + ), + ] = None + private_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="privateKey", + title=("PrivateKey refers to a K8s secret containing the GitHub app" " private key"), + ), + ] = None -class ExprFilter(BaseModel): - expr: Optional[str] = Field( - default=None, - description=("Expr refers to the expression that determines the outcome of the filter."), - ) - fields: Optional[List[PayloadField]] = Field( - default=None, - description=("Fields refers to set of keys that refer to the paths within event payload."), - ) +class PubSubEventSource(BaseModel): + credential_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="credentialSecret", + title=( + "CredentialSecret references to the secret that contains JSON" + " credentials to access GCP.\nIf it is missing, it implicitly uses" + " Workload Identity to" + " access.\nhttps://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity\n+optional" + ), + ), + ] = None + delete_subscription_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteSubscriptionOnFinish", + title=( + "DeleteSubscriptionOnFinish determines whether to delete the GCP PubSub" + " subscription once the event source is stopped.\n+optional" + ), + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + project_id: Annotated[ + Optional[str], + Field( + alias="projectID", + title=( + "ProjectID is GCP project ID for the subscription.\nRequired if you run" + " Argo Events outside of GKE/GCE.\n(otherwise, the default value is its" + " project)\n+optional" + ), + ), + ] = None + subscription_id: Annotated[ + Optional[str], + Field( + alias="subscriptionID", + title=( + "SubscriptionID is ID of subscription.\nRequired if you use existing" + " subscription.\nThe default value will be auto generated hash based on" + " this eventsource setting, so the subscription\nmight be recreated" + " every time you update the setting, which has a possibility of event" + " loss.\n+optional" + ), + ), + ] = None + topic: Annotated[ + Optional[str], + Field( + title=( + "Topic to which the subscription should belongs.\nRequired if you want" + " the eventsource to create a new subscription.\nIf you specify this" + " field along with an existing subscription,\nit will be verified" + " whether it actually belongs to the specified topic.\n+optional" + ) + ), + ] = None + topic_project_id: Annotated[ + Optional[str], + Field( + alias="topicProjectID", + title=( + "TopicProjectID is GCP project ID for the topic.\nBy default, it is" " same as ProjectID.\n+optional" + ), + ), + ] = None -class FileEventSource(BaseModel): - event_type: Optional[str] = Field( - default=None, - alias="eventType", - title=( - "Type of file operations to watch\nRefer" - " https://github.com/fsnotify/fsnotify/blob/master/fsnotify.go for more" - " information" - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - polling: Optional[bool] = Field(default=None, title="Use polling instead of inotify") - watch_path_config: Optional[WatchPathConfig] = Field( - default=None, - alias="watchPathConfig", - title="WatchPathConfig contains configuration about the file path to watch", - ) +class SASLConfig(BaseModel): + mechanism: Annotated[ + Optional[str], + Field( + title=( + "SASLMechanism is the name of the enabled SASL mechanism.\nPossible" + " values: OAUTHBEARER, PLAIN (defaults to PLAIN).\n+optional" + ) + ), + ] = None + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Password for SASL/PLAIN authentication"), + ] = None + user: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + title=( + "User is the authentication identity (authcid) to present" + " for\nSASL/PLAIN or SASL/SCRAM authentication" + ) + ), + ] = None -class GenericEventSource(BaseModel): - auth_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authSecret", - title=("AuthSecret holds a secret selector that contains a bearer token for" " authentication\n+optional"), - ) - config: Optional[str] = Field(default=None, title="Config is the event source configuration") - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - insecure: Optional[bool] = Field(default=None, description="Insecure determines the type of connection.") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - url: Optional[str] = Field( - default=None, - description="URL of the gRPC server that implements the event source.", - ) +class SQSEventSource(BaseModel): + access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessKey", + title="AccessKey refers K8s secret containing aws access key", + ), + ] = None + dlq: Annotated[ + Optional[bool], + Field( + title=( + "DLQ specifies if a dead-letter queue is configured for messages that" + " can't be processed successfully.\nIf set to true, messages with" + " invalid payload won't be acknowledged to allow to forward them" + " farther to the dead-letter queue.\nThe default value is" + " false.\n+optional" + ) + ), + ] = None + endpoint: Annotated[ + Optional[str], + Field( + title=( + "Endpoint configures connection to a specific SQS endpoint instead of" " Amazons servers\n+optional" + ) + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + queue: Annotated[Optional[str], Field(title="Queue is AWS SQS queue to listen to for messages")] = None + queue_account_id: Annotated[ + Optional[str], + Field( + alias="queueAccountId", + title=("QueueAccountID is the ID of the account that created the queue to" " monitor\n+optional"), + ), + ] = None + region: Annotated[Optional[str], Field(title="Region is AWS region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), + ), + ] = None + secret_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="secretKey", + title="SecretKey refers K8s secret containing aws secret key", + ), + ] = None + session_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sessionToken", + title=( + "SessionToken refers to K8s secret containing AWS temporary" + " credentials(STS) session token\n+optional" + ), + ), + ] = None + wait_time_seconds: Annotated[ + Optional[str], + Field( + alias="waitTimeSeconds", + description=( + "WaitTimeSeconds is The duration (in seconds) for which the call waits" + " for a message to arrive\nin the queue before returning." + ), + ), + ] = None -class GitCreds(BaseModel): - password: Optional[v1.SecretKeySelector] = None - username: Optional[v1.SecretKeySelector] = None +class TLSConfig(BaseModel): + ca_cert_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="caCertSecret", + title="CACertSecret refers to the secret that contains the CA cert", + ), + ] = None + client_cert_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="clientCertSecret", + title="ClientCertSecret refers to the secret that contains the client cert", + ), + ] = None + client_key_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="clientKeySecret", + title="ClientKeySecret refers to the secret that contains the client key", + ), + ] = None + insecure_skip_verify: Annotated[ + Optional[bool], + Field( + alias="insecureSkipVerify", + title=( + "If true, skips creation of TLSConfig with certs and creates an empty" + " TLSConfig. (Defaults to false)\n+optional" + ), + ), + ] = None -class GithubAppCreds(BaseModel): - app_id: Optional[str] = Field( - default=None, - alias="appID", - title="AppID refers to the GitHub App ID for the application you created", - ) - installation_id: Optional[str] = Field( - default=None, - alias="installationID", - title=("InstallationID refers to the Installation ID of the GitHub app you created" " and installed"), - ) - private_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="privateKey", - title="PrivateKey refers to a K8s secret containing the GitHub app private key", - ) +class WebhookContext(BaseModel): + auth_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="authSecret", + title=("AuthSecret holds a secret selector that contains a bearer token for" " authentication\n+optional"), + ), + ] = None + endpoint: Annotated[Optional[str], Field(title="REST API endpoint")] = None + max_payload_size: Annotated[ + Optional[str], + Field( + alias="maxPayloadSize", + title=( + "MaxPayloadSize is the maximum webhook payload size that the server" + " will accept.\nRequests exceeding that limit will be rejected with" + ' "request too large" response.\nDefault value: 1048576' + " (1MB).\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + method: Annotated[ + Optional[str], + Field( + title=( + "Method is HTTP request method that indicates the desired action to be" + " performed for a given resource.\nSee RFC7231 Hypertext Transfer" + " Protocol (HTTP/1.1): Semantics and Content" + ) + ), + ] = None + port: Annotated[ + Optional[str], + Field(description="Port on which HTTP server is listening for incoming events."), + ] = None + server_cert_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="serverCertSecret", + description="ServerCertPath refers the file that contains the cert.", + ), + ] = None + server_key_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="serverKeySecret", + title="ServerKeyPath refers the file that contains private key", + ), + ] = None + url: Annotated[Optional[str], Field(description="URL is the url of the server.")] = None -class HDFSEventSource(BaseModel): - addresses: Optional[List[str]] = None - check_interval: Optional[str] = Field( - default=None, - alias="checkInterval", - title=( - "CheckInterval is a string that describes an interval duration to check the" - " directory state, e.g. 1s, 30m, 2h... (defaults to 1m)" - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - hdfs_user: Optional[str] = Field( - default=None, - alias="hdfsUser", - description=( - "HDFSUser is the user to access HDFS file system.\nIt is ignored if either" " ccache or keytab is used." - ), - ) - krb_c_cache_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbCCacheSecret", - description=( - "KrbCCacheSecret is the secret selector for Kerberos ccache\nEither ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_config_config_map: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="krbConfigConfigMap", - description=( - "KrbConfig is the configmap selector for Kerberos config as string\nIt must" - " be set if either ccache or keytab is used." - ), - ) - krb_keytab_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbKeytabSecret", - description=( - "KrbKeytabSecret is the secret selector for Kerberos keytab\nEither ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_realm: Optional[str] = Field( - default=None, - alias="krbRealm", - description=("KrbRealm is the Kerberos realm used with Kerberos keytab\nIt must be set" " if keytab is used."), - ) - krb_service_principal_name: Optional[str] = Field( - default=None, - alias="krbServicePrincipalName", - description=( - "KrbServicePrincipalName is the principal name of Kerberos service\nIt must" - " be set if either ccache or keytab is used." - ), - ) - krb_username: Optional[str] = Field( - default=None, - alias="krbUsername", - description=( - "KrbUsername is the Kerberos username used with Kerberos keytab\nIt must be" " set if keytab is used." - ), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - type: Optional[str] = Field(default=None, title="Type of file operations to watch") - watch_path_config: Optional[WatchPathConfig] = Field(default=None, alias="watchPathConfig") +class ValueFromSource(BaseModel): + config_map_key_ref: Annotated[Optional[v1_1.ConfigMapKeySelector], Field(alias="configMapKeyRef")] = None + secret_key_ref: Annotated[Optional[v1_1.SecretKeySelector], Field(alias="secretKeyRef")] = None -class K8SResourcePolicy(BaseModel): - backoff: Optional[Backoff] = Field(default=None, title="Backoff before checking resource state") - error_on_backoff_timeout: Optional[bool] = Field( - default=None, - alias="errorOnBackoffTimeout", - title=( - "ErrorOnBackoffTimeout determines whether sensor should transition to error" - " state if the trigger policy is unable to determine\nthe state of the" - " resource" - ), - ) - labels: Optional[Dict[str, str]] = Field( - default=None, - title="Labels required to identify whether a resource is in success state", - ) +class Backoff(BaseModel): + duration: Annotated[ + Optional[Int64OrString], + Field(title=('The initial duration in nanoseconds or strings like "1s",' ' "3m"\n+optional')), + ] = None + factor: Annotated[ + Optional[Amount], + Field(title="Duration is multiplied by factor each iteration\n+optional"), + ] = None + jitter: Annotated[ + Optional[Amount], + Field(title="The amount of jitter applied each iteration\n+optional"), + ] = None + steps: Annotated[Optional[int], Field(title="Exit with error after this many steps\n+optional")] = None -class NATSAuth(BaseModel): - basic: Optional[BasicAuth] = Field(default=None, title="Baisc auth with username and password\n+optional") - credential: Optional[v1.SecretKeySelector] = Field(default=None, title="credential used to connect\n+optional") - nkey: Optional[v1.SecretKeySelector] = Field(default=None, title="NKey used to connect\n+optional") - token: Optional[v1.SecretKeySelector] = Field(default=None, title="Token used to connect\n+optional") +class ConditionsResetCriteria(BaseModel): + by_time: Annotated[ + Optional[ConditionsResetByTime], + Field( + alias="byTime", + title=("Schedule is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron"), + ), + ] = None -class PubSubEventSource(BaseModel): - credential_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="credentialSecret", - title=( - "CredentialSecret references to the secret that contains JSON credentials" - " to access GCP.\nIf it is missing, it implicitly uses Workload Identity to" - " access.\nhttps://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity\n+optional" - ), - ) - delete_subscription_on_finish: Optional[bool] = Field( - default=None, - alias="deleteSubscriptionOnFinish", - title=( - "DeleteSubscriptionOnFinish determines whether to delete the GCP PubSub" - " subscription once the event source is stopped.\n+optional" - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - project_id: Optional[str] = Field( - default=None, - alias="projectID", - title=( - "ProjectID is GCP project ID for the subscription.\nRequired if you run" - " Argo Events outside of GKE/GCE.\n(otherwise, the default value is its" - " project)\n+optional" - ), - ) - subscription_id: Optional[str] = Field( - default=None, - alias="subscriptionID", - title=( - "SubscriptionID is ID of subscription.\nRequired if you use existing" - " subscription.\nThe default value will be auto generated hash based on" - " this eventsource setting, so the subscription\nmight be recreated every" - " time you update the setting, which has a possibility of event" - " loss.\n+optional" - ), - ) - topic: Optional[str] = Field( - default=None, - title=( - "Topic to which the subscription should belongs.\nRequired if you want the" - " eventsource to create a new subscription.\nIf you specify this field" - " along with an existing subscription,\nit will be verified whether it" - " actually belongs to the specified topic.\n+optional" - ), - ) - topic_project_id: Optional[str] = Field( - default=None, - alias="topicProjectID", - title=("TopicProjectID is GCP project ID for the topic.\nBy default, it is same as" " ProjectID.\n+optional"), - ) +class EventPersistence(BaseModel): + catchup: Annotated[ + Optional[CatchupConfiguration], + Field(title=("Catchup enables to triggered the missed schedule when eventsource" " restarts")), + ] = None + config_map: Annotated[ + Optional[ConfigMapPersistence], + Field(alias="configMap", title="ConfigMap holds configmap details for persistence"), + ] = None -class ResourceFilter(BaseModel): - after_start: Optional[bool] = Field( - default=None, - alias="afterStart", - title=("If the resource is created after the start time then the event is treated" " as valid.\n+optional"), - ) - created_by: Optional[v1_1.Time] = Field( - default=None, - alias="createdBy", - title=("If resource is created before the specified time then the event is treated" " as valid.\n+optional"), - ) - fields: Optional[List[Selector]] = Field( - default=None, - title=( - "Fields provide field filters similar to K8s field selector\n(see" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/).\nUnlike" - " K8s field selector, it supports arbitrary fileds like" - ' "spec.serviceAccountName",\nand the value could be a string or a' - ' regex.\nSame as K8s field selector, operator "=", "==" and "!=" are' - " supported.\n+optional" - ), - ) - labels: Optional[List[Selector]] = Field( - default=None, - title=( - "Labels provide listing options to K8s API to watch resource/s.\nRefer" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/label-selectors/" - " for more io.argoproj.workflow.v1alpha1.\n+optional" - ), - ) - prefix: Optional[str] = Field(default=None, title="Prefix filter is applied on the resource name.\n+optional") +class FileEventSource(BaseModel): + event_type: Annotated[ + Optional[str], + Field( + alias="eventType", + title=( + "Type of file operations to watch\nRefer" + " https://github.com/fsnotify/fsnotify/blob/master/fsnotify.go for more" + " information" + ), + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + polling: Annotated[Optional[bool], Field(title="Use polling instead of inotify")] = None + watch_path_config: Annotated[ + Optional[WatchPathConfig], + Field( + alias="watchPathConfig", + title="WatchPathConfig contains configuration about the file path to watch", + ), + ] = None + + +class HDFSEventSource(BaseModel): + addresses: Optional[List[str]] = None + check_interval: Annotated[ + Optional[str], + Field( + alias="checkInterval", + title=( + "CheckInterval is a string that describes an interval duration to check" + " the directory state, e.g. 1s, 30m, 2h... (defaults to 1m)" + ), + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + hdfs_user: Annotated[ + Optional[str], + Field( + alias="hdfsUser", + description=( + "HDFSUser is the user to access HDFS file system.\nIt is ignored if" + " either ccache or keytab is used." + ), + ), + ] = None + krb_c_cache_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="krbCCacheSecret", + description=( + "KrbCCacheSecret is the secret selector for Kerberos ccache\nEither" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_config_config_map: Annotated[ + Optional[v1_1.ConfigMapKeySelector], + Field( + alias="krbConfigConfigMap", + description=( + "KrbConfig is the configmap selector for Kerberos config as string\nIt" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_keytab_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="krbKeytabSecret", + description=( + "KrbKeytabSecret is the secret selector for Kerberos keytab\nEither" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_realm: Annotated[ + Optional[str], + Field( + alias="krbRealm", + description=( + "KrbRealm is the Kerberos realm used with Kerberos keytab\nIt must be" " set if keytab is used." + ), + ), + ] = None + krb_service_principal_name: Annotated[ + Optional[str], + Field( + alias="krbServicePrincipalName", + description=( + "KrbServicePrincipalName is the principal name of Kerberos service\nIt" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_username: Annotated[ + Optional[str], + Field( + alias="krbUsername", + description=( + "KrbUsername is the Kerberos username used with Kerberos keytab\nIt" " must be set if keytab is used." + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + type: Annotated[Optional[str], Field(title="Type of file operations to watch")] = None + watch_path_config: Annotated[Optional[WatchPathConfig], Field(alias="watchPathConfig")] = None class S3Artifact(BaseModel): - access_key: Optional[v1.SecretKeySelector] = Field(default=None, alias="accessKey") + access_key: Annotated[Optional[v1_1.SecretKeySelector], Field(alias="accessKey")] = None bucket: Optional[S3Bucket] = None endpoint: Optional[str] = None events: Optional[List[str]] = None @@ -880,1846 +1240,2287 @@ class S3Artifact(BaseModel): insecure: Optional[bool] = None metadata: Optional[Dict[str, str]] = None region: Optional[str] = None - secret_key: Optional[v1.SecretKeySelector] = Field(default=None, alias="secretKey") + secret_key: Annotated[Optional[v1_1.SecretKeySelector], Field(alias="secretKey")] = None -class SASLConfig(BaseModel): - mechanism: Optional[str] = Field( - default=None, - title=( - "SASLMechanism is the name of the enabled SASL mechanism.\nPossible values:" - " OAUTHBEARER, PLAIN (defaults to PLAIN).\n+optional" - ), - ) - password: Optional[v1.SecretKeySelector] = Field(default=None, title="Password for SASL/PLAIN authentication") - user: Optional[v1.SecretKeySelector] = Field( - default=None, - title=( - "User is the authentication identity (authcid) to present for\nSASL/PLAIN" " or SASL/SCRAM authentication" - ), - ) +class TriggerParameter(BaseModel): + dest: Annotated[ + Optional[str], + Field( + description=( + "Dest is the JSONPath of a resource key.\nA path is a series of keys" + " separated by a dot. The colon character can be escaped with '.'\nThe" + " -1 key can be used to append a value to an existing array.\nSee" + " https://github.com/tidwall/sjson#path-syntax for more information" + " about how this is used." + ) + ), + ] = None + operation: Annotated[ + Optional[str], + Field( + description=( + "Operation is what to do with the existing value at Dest, whether" + " to\n'prepend', 'overwrite', or 'append' it." + ) + ), + ] = None + src: Annotated[ + Optional[TriggerParameterSource], + Field(title=("Src contains a source reference to the value of the parameter from a" " dependency")), + ] = None -class SQSEventSource(BaseModel): - access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKey", - title="AccessKey refers K8s secret containing aws access key", - ) - dlq: Optional[bool] = Field( - default=None, - title=( - "DLQ specifies if a dead-letter queue is configured for messages that can't" - " be processed successfully.\nIf set to true, messages with invalid payload" - " won't be acknowledged to allow to forward them farther to the dead-letter" - " queue.\nThe default value is false.\n+optional" - ), - ) - endpoint: Optional[str] = Field( - default=None, - title=("Endpoint configures connection to a specific SQS endpoint instead of" " Amazons servers\n+optional"), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - queue: Optional[str] = Field(default=None, title="Queue is AWS SQS queue to listen to for messages") - queue_account_id: Optional[str] = Field( - default=None, - alias="queueAccountId", - title=("QueueAccountID is the ID of the account that created the queue to" " monitor\n+optional"), - ) - region: Optional[str] = Field(default=None, title="Region is AWS region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), - ) - secret_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKey", - title="SecretKey refers K8s secret containing aws secret key", - ) - session_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sessionToken", - title=( - "SessionToken refers to K8s secret containing AWS temporary" " credentials(STS) session token\n+optional" - ), - ) - wait_time_seconds: Optional[str] = Field( - default=None, - alias="waitTimeSeconds", - description=( - "WaitTimeSeconds is The duration (in seconds) for which the call waits for" - " a message to arrive\nin the queue before returning." - ), - ) +class ResourceEventSource(BaseModel): + event_types: Annotated[ + Optional[List[str]], + Field( + alias="eventTypes", + description=( + "EventTypes is the list of event type to watch.\nPossible values are -" " ADD, UPDATE and DELETE." + ), + ), + ] = None + filter: Annotated[ + Optional[ResourceFilter], + Field( + title=( + "Filter is applied on the metadata of the resource\nIf you apply" + " filter, then the internal event informer will only monitor objects" + " that pass the filter.\n+optional" + ) + ), + ] = None + group_version_resource: Annotated[ + Optional[v1.GroupVersionResource], + Field(alias="groupVersionResource", title="Group of the resource"), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + namespace: Annotated[Optional[str], Field(title="Namespace where resource is deployed")] = None -class Status(BaseModel): - conditions: Optional[List[Condition]] = Field( - default=None, - title=( - "Conditions are the latest available observations of a resource's current" - " state.\n+optional\n+patchMergeKey=type\n+patchStrategy=merge" - ), - ) +class NATSAuth(BaseModel): + basic: Annotated[ + Optional[BasicAuth], + Field(title="Baisc auth with username and password\n+optional"), + ] = None + credential: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="credential used to connect\n+optional"), + ] = None + nkey: Annotated[Optional[v1_1.SecretKeySelector], Field(title="NKey used to connect\n+optional")] = None + token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Token used to connect\n+optional"), + ] = None -class TLSConfig(BaseModel): - ca_cert_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="caCertSecret", - title="CACertSecret refers to the secret that contains the CA cert", - ) - client_cert_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="clientCertSecret", - title="ClientCertSecret refers to the secret that contains the client cert", - ) - client_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="clientKeySecret", - title="ClientKeySecret refers to the secret that contains the client key", - ) - insecure_skip_verify: Optional[bool] = Field( - default=None, - alias="insecureSkipVerify", - title=( - "If true, skips creation of TLSConfig with certs and creates an empty" - " TLSConfig. (Defaults to false)\n+optional" - ), - ) +class BitbucketAuth(BaseModel): + basic: Annotated[ + Optional[BitbucketBasicAuth], + Field(title="Basic is BasicAuth auth strategy.\n+optional"), + ] = None + oauth_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="oauthToken", + title=("OAuthToken refers to the K8s secret that holds the OAuth Bearer" " token.\n+optional"), + ), + ] = None -class TriggerParameter(BaseModel): - dest: Optional[str] = Field( - default=None, - description=( - "Dest is the JSONPath of a resource key.\nA path is a series of keys" - " separated by a dot. The colon character can be escaped with '.'\nThe -1" - " key can be used to append a value to an existing array.\nSee" - " https://github.com/tidwall/sjson#path-syntax for more information about" - " how this is used." - ), - ) - operation: Optional[str] = Field( - default=None, - description=( - "Operation is what to do with the existing value at Dest, whether" - " to\n'prepend', 'overwrite', or 'append' it." - ), - ) - src: Optional[TriggerParameterSource] = Field( - default=None, - title=("Src contains a source reference to the value of the parameter from a" " dependency"), - ) +class GitArtifact(BaseModel): + branch: Annotated[Optional[str], Field(title="Branch to use to pull trigger resource\n+optional")] = None + clone_directory: Annotated[ + Optional[str], + Field( + alias="cloneDirectory", + description=( + "Directory to clone the repository. We clone complete directory because" + " GitArtifact is not limited to any specific Git service" + " providers.\nHence we don't use any specific git provider client." + ), + ), + ] = None + creds: Annotated[ + Optional[GitCreds], + Field(title="Creds contain reference to git username and password\n+optional"), + ] = None + file_path: Annotated[ + Optional[str], + Field( + alias="filePath", + title="Path to file that contains trigger resource definition", + ), + ] = None + insecure_ignore_host_key: Annotated[ + Optional[bool], + Field(alias="insecureIgnoreHostKey", title="Whether to ignore host key\n+optional"), + ] = None + ref: Annotated[ + Optional[str], + Field(title=("Ref to use to pull trigger resource. Will result in a shallow clone" " and\nfetch.\n+optional")), + ] = None + remote: Annotated[ + Optional[GitRemoteConfig], + Field( + title=( + "Remote to manage set of tracked repositories. Defaults to" + ' "origin".\nRefer https://git-scm.com/docs/git-remote\n+optional' + ) + ), + ] = None + ssh_key_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sshKeySecret", + title="SSHKeySecret refers to the secret that contains SSH key", + ), + ] = None + tag: Annotated[Optional[str], Field(title="Tag to use to pull trigger resource\n+optional")] = None + url: Annotated[Optional[str], Field(title="Git URL")] = None -class TriggerPolicy(BaseModel): - k8s: Optional[K8SResourcePolicy] = Field( - default=None, - title=( - "K8SResourcePolicy refers to the policy used to check the state of K8s" - " based triggers using using labels" - ), - ) - status: Optional[StatusPolicy] = Field( - default=None, - title=("Status refers to the policy used to check the state of the trigger using" " response status"), - ) +class KafkaTrigger(BaseModel): + compress: Annotated[ + Optional[bool], + Field( + title=( + "Compress determines whether to compress message or not.\nDefaults to" + " false.\nIf set to true, compresses message using snappy" + " compression.\n+optional" + ) + ), + ] = None + flush_frequency: Annotated[ + Optional[int], + Field( + alias="flushFrequency", + title=( + "FlushFrequency refers to the frequency in milliseconds to flush" + " batches.\nDefaults to 500 milliseconds.\n+optional" + ), + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=("Parameters is the list of parameters that is applied to resolved Kafka" " trigger object.") + ), + ] = None + partition: Annotated[Optional[int], Field(description="Partition to write data to.")] = None + partitioning_key: Annotated[ + Optional[str], + Field( + alias="partitioningKey", + description=( + "The partitioning key for the messages put on the Kafka" " topic.\nDefaults to broker url.\n+optional." + ), + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + required_acks: Annotated[ + Optional[int], + Field( + alias="requiredAcks", + description=( + "RequiredAcks used in producer to tell the broker how many replica" + " acknowledgements\nDefaults to 1 (Only wait for the leader to" + " ack).\n+optional." + ), + ), + ] = None + sasl: Annotated[ + Optional[SASLConfig], + Field(title="SASL configuration for the kafka client\n+optional"), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the Kafka producer.\n+optional"), + ] = None + topic: Annotated[ + Optional[str], + Field(title=("Name of the topic.\nMore info at" " https://kafka.apache.org/documentation/#intro_topics")), + ] = None + url: Annotated[ + Optional[str], + Field(description="URL of the Kafka broker, multiple URLs separated by comma."), + ] = None + version: Annotated[ + Optional[str], + Field( + title=( + "Specify what kafka version is being connected to enables certain" + " features in sarama, defaults to 1.0.0\n+optional" + ) + ), + ] = None -class ValueFromSource(BaseModel): - config_map_key_ref: Optional[v1.ConfigMapKeySelector] = Field(default=None, alias="configMapKeyRef") - secret_key_ref: Optional[v1.SecretKeySelector] = Field(default=None, alias="secretKeyRef") +class NATSTrigger(BaseModel): + parameters: Optional[List[TriggerParameter]] = None + payload: Optional[List[TriggerParameter]] = None + subject: Annotated[Optional[str], Field(description="Name of the subject to put message on.")] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the NATS producer.\n+optional"), + ] = None + url: Annotated[Optional[str], Field(description="URL of the NATS cluster.")] = None -class WebhookContext(BaseModel): - auth_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authSecret", - title=("AuthSecret holds a secret selector that contains a bearer token for" " authentication\n+optional"), - ) - endpoint: Optional[str] = Field(default=None, title="REST API endpoint") - max_payload_size: Optional[str] = Field( - default=None, - alias="maxPayloadSize", - title=( - "MaxPayloadSize is the maximum webhook payload size that the server will" - ' accept.\nRequests exceeding that limit will be rejected with "request too' - ' large" response.\nDefault value: 1048576 (1MB).\n+optional' - ), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - method: Optional[str] = Field( - default=None, - title=( - "Method is HTTP request method that indicates the desired action to be" - " performed for a given resource.\nSee RFC7231 Hypertext Transfer Protocol" - " (HTTP/1.1): Semantics and Content" - ), - ) - port: Optional[str] = Field( - default=None, - description="Port on which HTTP server is listening for incoming events.", - ) - server_cert_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serverCertSecret", - description="ServerCertPath refers the file that contains the cert.", - ) - server_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serverKeySecret", - title="ServerKeyPath refers the file that contains private key", - ) - url: Optional[str] = Field(default=None, description="URL is the url of the server.") +class RedisEventSource(BaseModel): + channels: Optional[List[str]] = None + db: Annotated[ + Optional[int], + Field(title="DB to use. If not specified, default DB 0 will be used.\n+optional"), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + host_address: Annotated[ + Optional[str], + Field( + alias="hostAddress", + title="HostAddress refers to the address of the Redis host/server", + ), + ] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + namespace: Annotated[ + Optional[str], + Field( + title=( + "Namespace to use to retrieve the password from. It should only be" + " specified if password is declared\n+optional" + ) + ), + ] = None + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Password required for authentication if any.\n+optional"), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the redis client.\n+optional"), + ] = None + username: Annotated[ + Optional[str], + Field(title="Username required for ACL style authentication if any.\n+optional"), + ] = None -class WebhookEventSource(BaseModel): - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - webhook_context: Optional[WebhookContext] = Field(default=None, alias="webhookContext") +class RedisStreamEventSource(BaseModel): + consumer_group: Annotated[ + Optional[str], + Field( + alias="consumerGroup", + title=( + "ConsumerGroup refers to the Redis stream consumer group that will" + " be\ncreated on all redis streams. Messages are read through this" + " group. Defaults to 'argo-events-cg'\n+optional" + ), + ), + ] = None + db: Annotated[ + Optional[int], + Field(title="DB to use. If not specified, default DB 0 will be used.\n+optional"), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + host_address: Annotated[ + Optional[str], + Field( + alias="hostAddress", + title=("HostAddress refers to the address of the Redis host/server (master" " instance)"), + ), + ] = None + max_msg_count_per_read: Annotated[ + Optional[int], + Field( + alias="maxMsgCountPerRead", + title=( + "MaxMsgCountPerRead holds the maximum number of messages per stream" + " that will be read in each XREADGROUP of all streams\nExample: if" + " there are 2 streams and MaxMsgCountPerRead=10, then each XREADGROUP" + " may read upto a total of 20 messages.\nSame as COUNT option in" + " XREADGROUP(https://redis.io/topics/streams-intro). Defaults to" + " 10\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Password required for authentication if any.\n+optional"), + ] = None + streams: Annotated[ + Optional[List[str]], + Field( + description=( + "Streams to look for entries. XREADGROUP is used on all streams using a" " single consumer group." + ) + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the redis client.\n+optional"), + ] = None + username: Annotated[ + Optional[str], + Field(title="Username required for ACL style authentication if any.\n+optional"), + ] = None -class AMQPEventSource(BaseModel): - auth: Optional[BasicAuth] = Field( - default=None, - title="Auth hosts secret selectors for username and password\n+optional", - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - consume: Optional[AMQPConsumeConfig] = Field( - default=None, - title=( - "Consume holds the configuration to immediately starts delivering queued" - " messages\nFor more information, visit" - " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.Consume\n+optional" - ), - ) - exchange_declare: Optional[AMQPExchangeDeclareConfig] = Field( - default=None, - alias="exchangeDeclare", - title=( - "ExchangeDeclare holds the configuration for the exchange on the" - " server\nFor more information, visit" - " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.ExchangeDeclare\n+optional" - ), - ) - exchange_name: Optional[str] = Field( - default=None, - alias="exchangeName", - title=( - "ExchangeName is the exchange name\nFor more information, visit" - " https://www.rabbitmq.com/tutorials/amqp-concepts.html" - ), - ) - exchange_type: Optional[str] = Field( - default=None, - alias="exchangeType", - title="ExchangeType is rabbitmq exchange type", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - queue_bind: Optional[AMQPQueueBindConfig] = Field( - default=None, - alias="queueBind", - title=( - "QueueBind holds the configuration that binds an exchange to a queue so" - " that publishings to the\nexchange will be routed to the queue when the" - " publishing routing key matches the binding routing key\nFor more" - " information, visit" - " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueBind\n+optional" - ), - ) - queue_declare: Optional[AMQPQueueDeclareConfig] = Field( - default=None, - alias="queueDeclare", - title=( - "QueueDeclare holds the configuration of a queue to hold messages and" - " deliver to consumers.\nDeclaring creates a queue if it doesn't already" - " exist, or ensures that an existing queue matches\nthe same" - " parameters\nFor more information, visit" - " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueDeclare\n+optional" - ), - ) - routing_key: Optional[str] = Field(default=None, alias="routingKey", title="Routing key for bindings") - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the amqp client.\n+optional") - url: Optional[str] = Field(default=None, title="URL for rabbitmq service") - url_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="urlSecret", - title="URLSecret is secret reference for rabbitmq service URL", - ) +class BitbucketServerEventSource(BaseModel): + access_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessToken", + title=("AccessToken is reference to K8s secret which holds the bitbucket api" " access information"), + ), + ] = None + bitbucketserver_base_url: Annotated[ + Optional[str], + Field( + alias="bitbucketserverBaseURL", + title=("BitbucketServerBaseURL is the base URL for API requests to a custom" " endpoint"), + ), + ] = None + delete_hook_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteHookOnFinish", + title=( + "DeleteHookOnFinish determines whether to delete the Bitbucket Server" + " hook for the project once the event source is stopped.\n+optional" + ), + ), + ] = None + events: Annotated[ + Optional[List[str]], + Field( + title=( + "Events are bitbucket event to listen to.\nRefer" + " https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html" + ) + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + project_key: Annotated[ + Optional[str], + Field( + alias="projectKey", + title=( + "DeprecatedProjectKey is the key of project for which integration needs" + " to set up\nDeprecated: use Repositories instead. Will be unsupported" + " in v1.8\n+optional" + ), + ), + ] = None + repositories: Annotated[ + Optional[List[BitbucketServerRepository]], + Field(title=("Repositories holds a list of repositories for which integration needs" " to set up\n+optional")), + ] = None + repository_slug: Annotated[ + Optional[str], + Field( + alias="repositorySlug", + title=( + "DeprecatedRepositorySlug is the slug of the repository for which" + " integration needs to set up\nDeprecated: use Repositories instead." + " Will be unsupported in v1.8\n+optional" + ), + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration to run a http server"), + ] = None + webhook_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="webhookSecret", + title=( + "WebhookSecret is reference to K8s secret which holds the bitbucket" + " webhook secret (for HMAC validation)" + ), + ), + ] = None -class AWSLambdaTrigger(BaseModel): - access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKey", - title="AccessKey refers K8s secret containing aws access key\n+optional", - ) - function_name: Optional[str] = Field( - default=None, - alias="functionName", - description="FunctionName refers to the name of the function to invoke.", - ) - invocation_type: Optional[str] = Field( - default=None, - alias="invocationType", - description=( - "Choose from the following options.\n\n * RequestResponse (default) -" - " Invoke the function synchronously. Keep\n the connection open until the" - " function returns a response or times out.\n The API response includes" - " the function response and additional data.\n\n * Event - Invoke the" - " function asynchronously. Send events that fail multiple\n times to the" - " function's dead-letter queue (if it's configured). The API\n response" - " only includes a status code.\n\n * DryRun - Validate parameter values" - " and verify that the user or role\n has permission to invoke the" - " function.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe trigger resource.\n+optional" - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - region: Optional[str] = Field(default=None, title="Region is AWS region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), - ) - secret_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKey", - title="SecretKey refers K8s secret containing aws secret key\n+optional", - ) +class GithubEventSource(BaseModel): + active: Annotated[ + Optional[bool], + Field( + title=( + "Active refers to status of the webhook for event" + " deliveries.\nhttps://developer.github.com/webhooks/creating/#active\n+optional" + ) + ), + ] = None + api_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="apiToken", + title=("APIToken refers to a K8s secret containing github api token\n+optional"), + ), + ] = None + content_type: Annotated[ + Optional[str], + Field(alias="contentType", title="ContentType of the event delivery"), + ] = None + delete_hook_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteHookOnFinish", + title=( + "DeleteHookOnFinish determines whether to delete the GitHub hook for" + " the repository once the event source is stopped.\n+optional" + ), + ), + ] = None + events: Annotated[ + Optional[List[str]], + Field(title=("Events refer to Github events to which the event source will subscribe")), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + github_app: Annotated[ + Optional[GithubAppCreds], + Field( + alias="githubApp", + title="GitHubApp holds the GitHub app credentials\n+optional", + ), + ] = None + github_base_url: Annotated[ + Optional[str], + Field( + alias="githubBaseURL", + title="GitHub base URL (for GitHub Enterprise)\n+optional", + ), + ] = None + github_upload_url: Annotated[ + Optional[str], + Field( + alias="githubUploadURL", + title="GitHub upload URL (for GitHub Enterprise)\n+optional", + ), + ] = None + id: Annotated[ + Optional[str], + Field( + title=( + "Id is the webhook's id\nDeprecated: This is not used at all, will be" " removed in v1.6\n+optional" + ) + ), + ] = None + insecure: Annotated[Optional[bool], Field(title="Insecure tls verification")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + organizations: Annotated[ + Optional[List[str]], + Field( + description=( + "Organizations holds the names of organizations (used for organization" + " level webhooks). Not required if Repositories is set." + ) + ), + ] = None + owner: Annotated[ + Optional[str], + Field( + title=( + "DeprecatedOwner refers to GitHub owner name i.e. argoproj\nDeprecated:" + " use Repositories instead. Will be unsupported in v 1.6\n+optional" + ) + ), + ] = None + repositories: Annotated[ + Optional[List[OwnedRepositories]], + Field( + description=( + "Repositories holds the information of repositories, which uses repo" + " owner as the key,\nand list of repo names as the value. Not required" + " if Organizations is set." + ) + ), + ] = None + repository: Annotated[ + Optional[str], + Field( + title=( + "DeprecatedRepository refers to GitHub repo name i.e." + " argo-events\nDeprecated: use Repositories instead. Will be" + " unsupported in v 1.6\n+optional" + ) + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook refers to the configuration required to run a http server"), + ] = None + webhook_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="webhookSecret", + title=( + "WebhookSecret refers to K8s secret containing GitHub webhook" + " secret\nhttps://developer.github.com/webhooks/securing/\n+optional" + ), + ), + ] = None -class AzureEventHubsTrigger(BaseModel): - fqdn: Optional[str] = Field( - default=None, - title=( - "FQDN refers to the namespace dns of Azure Event Hubs to be used i.e." - " .servicebus.windows.net" - ), - ) - hub_name: Optional[str] = Field( - default=None, - alias="hubName", - title="HubName refers to the Azure Event Hub to send events to", - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe trigger resource.\n+optional" - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - shared_access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sharedAccessKey", - title=("SharedAccessKey refers to a K8s secret containing the primary key for the"), - ) - shared_access_key_name: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sharedAccessKeyName", - title="SharedAccessKeyName refers to the name of the Shared Access Key", - ) +class GitlabEventSource(BaseModel): + access_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessToken", + title=("AccessToken references to k8 secret which holds the gitlab api access" " information"), + ), + ] = None + delete_hook_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteHookOnFinish", + title=( + "DeleteHookOnFinish determines whether to delete the GitLab hook for" + " the project once the event source is stopped.\n+optional" + ), + ), + ] = None + enable_ssl_verification: Annotated[ + Optional[bool], + Field( + alias="enableSSLVerification", + title="EnableSSLVerification to enable ssl verification\n+optional", + ), + ] = None + events: Annotated[ + Optional[List[str]], + Field( + description=( + "Events are gitlab event to listen to.\nRefer" + " https://github.com/xanzy/go-gitlab/blob/bf34eca5d13a9f4c3f501d8a97b8ac226d55e4d9/projects.go#L794." + ) + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + gitlab_base_url: Annotated[ + Optional[str], + Field( + alias="gitlabBaseURL", + title="GitlabBaseURL is the base URL for API requests to a custom endpoint", + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + project_id: Annotated[ + Optional[str], + Field( + alias="projectID", + title=( + "DeprecatedProjectID is the id of project for which integration needs" + " to setup\nDeprecated: use Projects instead. Will be unsupported in v" + " 1.7\n+optional" + ), + ), + ] = None + projects: Annotated[ + Optional[List[str]], + Field(title='List of project IDs or project namespace paths like "whynowy/test"'), + ] = None + secret_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="secretToken", + title=("SecretToken references to k8 secret which holds the Secret Token used" " by webhook config"), + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration to run a http server"), + ] = None -class BitbucketAuth(BaseModel): - basic: Optional[BitbucketBasicAuth] = Field(default=None, title="Basic is BasicAuth auth strategy.\n+optional") - oauth_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="oauthToken", - title=("OAuthToken refers to the K8s secret that holds the OAuth Bearer" " token.\n+optional"), - ) +class SNSEventSource(BaseModel): + access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessKey", + title="AccessKey refers K8s secret containing aws access key", + ), + ] = None + endpoint: Annotated[ + Optional[str], + Field( + title=( + "Endpoint configures connection to a specific SNS endpoint instead of" " Amazons servers\n+optional" + ) + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + region: Annotated[Optional[str], Field(title="Region is AWS region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), + ), + ] = None + secret_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="secretKey", + title="SecretKey refers K8s secret containing aws secret key", + ), + ] = None + topic_arn: Annotated[Optional[str], Field(alias="topicArn", title="TopicArn")] = None + validate_signature: Annotated[ + Optional[bool], + Field( + alias="validateSignature", + title=( + "ValidateSignature is boolean that can be set to true for SNS signature" " verification\n+optional" + ), + ), + ] = None + webhook: Annotated[Optional[WebhookContext], Field(title="Webhook configuration for http server")] = None -class BitbucketEventSource(BaseModel): - auth: Optional[BitbucketAuth] = Field( - default=None, description="Auth information required to connect to Bitbucket." - ) - delete_hook_on_finish: Optional[bool] = Field( - default=None, - alias="deleteHookOnFinish", - title=( - "DeleteHookOnFinish determines whether to delete the defined Bitbucket hook" - " once the event source is stopped.\n+optional" - ), - ) - events: Optional[List[str]] = Field(default=None, description="Events this webhook is subscribed to.") - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will be passed along the" " event payload.\n+optional"), - ) - owner: Optional[str] = Field( - default=None, - title=( - "DeprecatedOwner is the owner of the repository.\nDeprecated: use" - " Repositories instead. Will be unsupported in v1.9\n+optional" - ), - ) - project_key: Optional[str] = Field( - default=None, - alias="projectKey", - title=( - "DeprecatedProjectKey is the key of the project to which the repository" - " relates\nDeprecated: use Repositories instead. Will be unsupported in" - " v1.9\n+optional" - ), - ) - repositories: Optional[List[BitbucketRepository]] = Field( - default=None, - title=("Repositories holds a list of repositories for which integration needs to" " set up\n+optional"), - ) - repository_slug: Optional[str] = Field( - default=None, - alias="repositorySlug", - title=( - "DeprecatedRepositorySlug is a URL-friendly version of a repository name," - " automatically generated by Bitbucket for use in the URL\nDeprecated: use" - " Repositories instead. Will be unsupported in v1.9\n+optional" - ), - ) - webhook: Optional[WebhookContext] = Field( - default=None, - title="Webhook refers to the configuration required to run an http server", - ) +class SlackEventSource(BaseModel): + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + signing_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(alias="signingSecret", title="Slack App signing secret"), + ] = None + token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Token for URL verification handshake"), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration for a REST endpoint"), + ] = None -class BitbucketServerEventSource(BaseModel): - access_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessToken", - title=("AccessToken is reference to K8s secret which holds the bitbucket api" " access information"), - ) - bitbucketserver_base_url: Optional[str] = Field( - default=None, - alias="bitbucketserverBaseURL", - title=("BitbucketServerBaseURL is the base URL for API requests to a custom" " endpoint"), - ) - delete_hook_on_finish: Optional[bool] = Field( - default=None, - alias="deleteHookOnFinish", - title=( - "DeleteHookOnFinish determines whether to delete the Bitbucket Server hook" - " for the project once the event source is stopped.\n+optional" - ), - ) - events: Optional[List[str]] = Field( - default=None, - title=( - "Events are bitbucket event to listen to.\nRefer" - " https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html" - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - project_key: Optional[str] = Field( - default=None, - alias="projectKey", - title=( - "DeprecatedProjectKey is the key of project for which integration needs to" - " set up\nDeprecated: use Repositories instead. Will be unsupported in" - " v1.8\n+optional" - ), - ) - repositories: Optional[List[BitbucketServerRepository]] = Field( - default=None, - title=("Repositories holds a list of repositories for which integration needs to" " set up\n+optional"), - ) - repository_slug: Optional[str] = Field( - default=None, - alias="repositorySlug", - title=( - "DeprecatedRepositorySlug is the slug of the repository for which" - " integration needs to set up\nDeprecated: use Repositories instead. Will" - " be unsupported in v1.8\n+optional" - ), - ) - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration to run a http server") - webhook_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="webhookSecret", - title=( - "WebhookSecret is reference to K8s secret which holds the bitbucket webhook" - " secret (for HMAC validation)" - ), - ) +class StorageGridEventSource(BaseModel): + api_url: Annotated[ + Optional[str], + Field(alias="apiURL", description="APIURL is the url of the storagegrid api."), + ] = None + auth_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(alias="authToken", title="Auth token for storagegrid api"), + ] = None + bucket: Annotated[ + Optional[str], + Field(description="Name of the bucket to register notifications for."), + ] = None + events: Optional[List[str]] = None + filter: Annotated[ + Optional[StorageGridFilter], + Field(description="Filter on object key which caused the notification."), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + region: Annotated[Optional[str], Field(title="S3 region.\nDefaults to us-east-1\n+optional")] = None + topic_arn: Annotated[Optional[str], Field(alias="topicArn", title="TopicArn")] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration for a REST endpoint"), + ] = None -class CustomTrigger(BaseModel): - cert_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="certSecret", - description=( - "CertSecret refers to the secret that contains cert for secure connection" - " between sensor and custom trigger gRPC server." - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Parameters is the list of parameters that is applied to resolved custom" " trigger trigger object." - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - secure: Optional[bool] = Field( - default=None, - title=("Secure refers to type of the connection between sensor to custom trigger" " gRPC"), - ) - server_name_override: Optional[str] = Field( - default=None, - alias="serverNameOverride", - description=("ServerNameOverride for the secure connection between sensor and custom" " trigger gRPC server."), - ) - server_url: Optional[str] = Field( - default=None, - alias="serverURL", - title="ServerURL is the url of the gRPC server that executes custom trigger", - ) - spec: Optional[Dict[str, str]] = Field( - default=None, - description=( - "Spec is the custom trigger resource specification that custom trigger gRPC" - " server knows how to interpret." - ), - ) +class StripeEventSource(BaseModel): + api_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="apiKey", + title=( + "APIKey refers to K8s secret that holds Stripe API key. Used only if" + " CreateWebhook is enabled.\n+optional" + ), + ), + ] = None + create_webhook: Annotated[ + Optional[bool], + Field( + alias="createWebhook", + title=("CreateWebhook if specified creates a new webhook" " programmatically.\n+optional"), + ), + ] = None + event_filter: Annotated[ + Optional[List[str]], + Field( + alias="eventFilter", + title=( + "EventFilter describes the type of events to listen to. If not" + " specified, all types of events will be processed.\nMore info at" + " https://stripe.com/docs/api/events/list\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration for a REST endpoint"), + ] = None -class EmitterEventSource(BaseModel): - broker: Optional[str] = Field(default=None, description="Broker URI to connect to.") - channel_key: Optional[str] = Field(default=None, alias="channelKey", title="ChannelKey refers to the channel key") - channel_name: Optional[str] = Field( - default=None, - alias="channelName", - title="ChannelName refers to the channel name", - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - password: Optional[v1.SecretKeySelector] = Field( - default=None, title="Password to use to connect to broker\n+optional" - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the emitter client.\n+optional") - username: Optional[v1.SecretKeySelector] = Field( - default=None, title="Username to use to connect to broker\n+optional" - ) +class WebhookEventSource(BaseModel): + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + webhook_context: Annotated[Optional[WebhookContext], Field(alias="webhookContext")] = None -class EventDependencyFilter(BaseModel): - context: Optional[EventContext] = Field(default=None, title="Context filter constraints") - data: Optional[List[DataFilter]] = Field(default=None, title="Data filter constraints with escalation") - data_logical_operator: Optional[str] = Field( - default=None, - alias="dataLogicalOperator", - description=( - "DataLogicalOperator defines how multiple Data filters (if defined) are" - " evaluated together.\nAvailable values: and (&&), or (||)\nIs optional and" - " if left blank treated as and (&&)." - ), - ) - expr_logical_operator: Optional[str] = Field( - default=None, - alias="exprLogicalOperator", - description=( - "ExprLogicalOperator defines how multiple Exprs filters (if defined) are" - " evaluated together.\nAvailable values: and (&&), or (||)\nIs optional and" - " if left blank treated as and (&&)." - ), - ) - exprs: Optional[List[ExprFilter]] = Field( - default=None, - description=("Exprs contains the list of expressions evaluated against the event" " payload."), - ) - script: Optional[str] = Field( - default=None, - description=( - "Script refers to a Lua script evaluated to determine the validity of an" " io.argoproj.workflow.v1alpha1." - ), - ) - time: Optional[TimeFilter] = Field(default=None, title="Time filter on the event with escalation") +class SecureHeader(BaseModel): + name: Optional[str] = None + value_from: Annotated[ + Optional[ValueFromSource], + Field( + alias="valueFrom", + title="Values can be read from either secrets or configmaps", + ), + ] = None -class EventSourceStatus(BaseModel): - status: Optional[Status] = None +class AMQPEventSource(BaseModel): + auth: Annotated[ + Optional[BasicAuth], + Field(title="Auth hosts secret selectors for username and password\n+optional"), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + consume: Annotated[ + Optional[AMQPConsumeConfig], + Field( + title=( + "Consume holds the configuration to immediately starts delivering" + " queued messages\nFor more information, visit" + " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.Consume\n+optional" + ) + ), + ] = None + exchange_declare: Annotated[ + Optional[AMQPExchangeDeclareConfig], + Field( + alias="exchangeDeclare", + title=( + "ExchangeDeclare holds the configuration for the exchange on the" + " server\nFor more information, visit" + " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.ExchangeDeclare\n+optional" + ), + ), + ] = None + exchange_name: Annotated[ + Optional[str], + Field( + alias="exchangeName", + title=( + "ExchangeName is the exchange name\nFor more information, visit" + " https://www.rabbitmq.com/tutorials/amqp-concepts.html" + ), + ), + ] = None + exchange_type: Annotated[ + Optional[str], + Field(alias="exchangeType", title="ExchangeType is rabbitmq exchange type"), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + queue_bind: Annotated[ + Optional[AMQPQueueBindConfig], + Field( + alias="queueBind", + title=( + "QueueBind holds the configuration that binds an exchange to a queue so" + " that publishings to the\nexchange will be routed to the queue when" + " the publishing routing key matches the binding routing key\nFor more" + " information, visit" + " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueBind\n+optional" + ), + ), + ] = None + queue_declare: Annotated[ + Optional[AMQPQueueDeclareConfig], + Field( + alias="queueDeclare", + title=( + "QueueDeclare holds the configuration of a queue to hold messages and" + " deliver to consumers.\nDeclaring creates a queue if it doesn't" + " already exist, or ensures that an existing queue matches\nthe same" + " parameters\nFor more information, visit" + " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueDeclare\n+optional" + ), + ), + ] = None + routing_key: Annotated[Optional[str], Field(alias="routingKey", title="Routing key for bindings")] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the amqp client.\n+optional"), + ] = None + url: Annotated[Optional[str], Field(title="URL for rabbitmq service")] = None + url_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="urlSecret", + title="URLSecret is secret reference for rabbitmq service URL", + ), + ] = None -class GitArtifact(BaseModel): - branch: Optional[str] = Field(default=None, title="Branch to use to pull trigger resource\n+optional") - clone_directory: Optional[str] = Field( - default=None, - alias="cloneDirectory", - description=( - "Directory to clone the repository. We clone complete directory because" - " GitArtifact is not limited to any specific Git service providers.\nHence" - " we don't use any specific git provider client." - ), - ) - creds: Optional[GitCreds] = Field( - default=None, - title="Creds contain reference to git username and password\n+optional", - ) - file_path: Optional[str] = Field( - default=None, - alias="filePath", - title="Path to file that contains trigger resource definition", - ) - insecure_ignore_host_key: Optional[bool] = Field( - default=None, - alias="insecureIgnoreHostKey", - title="Whether to ignore host key\n+optional", - ) - ref: Optional[str] = Field( - default=None, - title=("Ref to use to pull trigger resource. Will result in a shallow clone" " and\nfetch.\n+optional"), - ) - remote: Optional[GitRemoteConfig] = Field( - default=None, - title=( - 'Remote to manage set of tracked repositories. Defaults to "origin".\nRefer' - " https://git-scm.com/docs/git-remote\n+optional" - ), - ) - ssh_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sshKeySecret", - title="SSHKeySecret refers to the secret that contains SSH key", - ) - tag: Optional[str] = Field(default=None, title="Tag to use to pull trigger resource\n+optional") - url: Optional[str] = Field(default=None, title="Git URL") +class EmitterEventSource(BaseModel): + broker: Annotated[Optional[str], Field(description="Broker URI to connect to.")] = None + channel_key: Annotated[ + Optional[str], + Field(alias="channelKey", title="ChannelKey refers to the channel key"), + ] = None + channel_name: Annotated[ + Optional[str], + Field(alias="channelName", title="ChannelName refers to the channel name"), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Password to use to connect to broker\n+optional"), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the emitter client.\n+optional"), + ] = None + username: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Username to use to connect to broker\n+optional"), + ] = None -class GithubEventSource(BaseModel): - active: Optional[bool] = Field( - default=None, - title=( - "Active refers to status of the webhook for event" - " deliveries.\nhttps://developer.github.com/webhooks/creating/#active\n+optional" - ), - ) - api_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="apiToken", - title="APIToken refers to a K8s secret containing github api token\n+optional", - ) - content_type: Optional[str] = Field(default=None, alias="contentType", title="ContentType of the event delivery") - delete_hook_on_finish: Optional[bool] = Field( - default=None, - alias="deleteHookOnFinish", - title=( - "DeleteHookOnFinish determines whether to delete the GitHub hook for the" - " repository once the event source is stopped.\n+optional" - ), - ) - events: Optional[List[str]] = Field( - default=None, - title="Events refer to Github events to which the event source will subscribe", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - github_app: Optional[GithubAppCreds] = Field( - default=None, - alias="githubApp", - title="GitHubApp holds the GitHub app credentials\n+optional", - ) - github_base_url: Optional[str] = Field( - default=None, - alias="githubBaseURL", - title="GitHub base URL (for GitHub Enterprise)\n+optional", - ) - github_upload_url: Optional[str] = Field( - default=None, - alias="githubUploadURL", - title="GitHub upload URL (for GitHub Enterprise)\n+optional", - ) - id: Optional[str] = Field( - default=None, - title=("Id is the webhook's id\nDeprecated: This is not used at all, will be" " removed in v1.6\n+optional"), - ) - insecure: Optional[bool] = Field(default=None, title="Insecure tls verification") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - organizations: Optional[List[str]] = Field( - default=None, - description=( - "Organizations holds the names of organizations (used for organization" - " level webhooks). Not required if Repositories is set." - ), - ) - owner: Optional[str] = Field( - default=None, - title=( - "DeprecatedOwner refers to GitHub owner name i.e. argoproj\nDeprecated: use" - " Repositories instead. Will be unsupported in v 1.6\n+optional" - ), - ) - repositories: Optional[List[OwnedRepositories]] = Field( - default=None, - description=( - "Repositories holds the information of repositories, which uses repo owner" - " as the key,\nand list of repo names as the value. Not required if" - " Organizations is set." - ), - ) - repository: Optional[str] = Field( - default=None, - title=( - "DeprecatedRepository refers to GitHub repo name i.e." - " argo-events\nDeprecated: use Repositories instead. Will be unsupported in" - " v 1.6\n+optional" - ), - ) - webhook: Optional[WebhookContext] = Field( - default=None, - title="Webhook refers to the configuration required to run a http server", - ) - webhook_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="webhookSecret", - title=( - "WebhookSecret refers to K8s secret containing GitHub webhook" - " secret\nhttps://developer.github.com/webhooks/securing/\n+optional" - ), - ) +class K8SResourcePolicy(BaseModel): + backoff: Annotated[Optional[Backoff], Field(title="Backoff before checking resource state")] = None + error_on_backoff_timeout: Annotated[ + Optional[bool], + Field( + alias="errorOnBackoffTimeout", + title=( + "ErrorOnBackoffTimeout determines whether sensor should transition to" + " error state if the trigger policy is unable to determine\nthe state" + " of the resource" + ), + ), + ] = None + labels: Annotated[ + Optional[Dict[str, str]], + Field(title="Labels required to identify whether a resource is in success state"), + ] = None -class GitlabEventSource(BaseModel): - access_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessToken", - title=("AccessToken references to k8 secret which holds the gitlab api access" " information"), - ) - delete_hook_on_finish: Optional[bool] = Field( - default=None, - alias="deleteHookOnFinish", - title=( - "DeleteHookOnFinish determines whether to delete the GitLab hook for the" - " project once the event source is stopped.\n+optional" - ), - ) - enable_ssl_verification: Optional[bool] = Field( - default=None, - alias="enableSSLVerification", - title="EnableSSLVerification to enable ssl verification\n+optional", - ) - events: Optional[List[str]] = Field( - default=None, - description=( - "Events are gitlab event to listen to.\nRefer" - " https://github.com/xanzy/go-gitlab/blob/bf34eca5d13a9f4c3f501d8a97b8ac226d55e4d9/projects.go#L794." - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - gitlab_base_url: Optional[str] = Field( - default=None, - alias="gitlabBaseURL", - title="GitlabBaseURL is the base URL for API requests to a custom endpoint", - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - project_id: Optional[str] = Field( - default=None, - alias="projectID", - title=( - "DeprecatedProjectID is the id of project for which integration needs to" - " setup\nDeprecated: use Projects instead. Will be unsupported in v" - " 1.7\n+optional" - ), - ) - projects: Optional[List[str]] = Field( - default=None, - title='List of project IDs or project namespace paths like "whynowy/test"', - ) - secret_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretToken", - title=("SecretToken references to k8 secret which holds the Secret Token used by" " webhook config"), - ) - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration to run a http server") +class KafkaEventSource(BaseModel): + config: Annotated[ + Optional[str], + Field( + description=( + "Yaml format Sarama config for Kafka connection.\nIt follows the struct" + " of sarama.Config. See" + " https://github.com/Shopify/sarama/blob/main/config.go\ne.g.\n\nconsumer:\n" + " fetch:\n min: 1\nnet:\n MaxOpenRequests: 5\n\n+optional" + ) + ), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + description="Backoff holds parameters applied to connection.", + ), + ] = None + consumer_group: Annotated[ + Optional[KafkaConsumerGroup], + Field(alias="consumerGroup", title="Consumer group for kafka client\n+optional"), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + limit_events_per_second: Annotated[ + Optional[str], + Field( + alias="limitEventsPerSecond", + title=("Sets a limit on how many events get read from kafka per" " second.\n+optional"), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + partition: Annotated[Optional[str], Field(title="Partition name")] = None + sasl: Annotated[ + Optional[SASLConfig], + Field(title="SASL configuration for the kafka client\n+optional"), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the kafka client.\n+optional"), + ] = None + topic: Annotated[Optional[str], Field(title="Topic name")] = None + url: Annotated[ + Optional[str], + Field(title="URL to kafka cluster, multiple URLs separated by comma"), + ] = None + version: Annotated[ + Optional[str], + Field( + title=( + "Specify what kafka version is being connected to enables certain" + " features in sarama, defaults to 1.0.0\n+optional" + ) + ), + ] = None -class KafkaEventSource(BaseModel): - config: Optional[str] = Field( - default=None, - description=( - "Yaml format Sarama config for Kafka connection.\nIt follows the struct of" - " sarama.Config. See" - " https://github.com/Shopify/sarama/blob/main/config.go\ne.g.\n\nconsumer:\n" - " fetch:\n min: 1\nnet:\n MaxOpenRequests: 5\n\n+optional" - ), - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - description="Backoff holds parameters applied to connection.", - ) - consumer_group: Optional[KafkaConsumerGroup] = Field( - default=None, - alias="consumerGroup", - title="Consumer group for kafka client\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - limit_events_per_second: Optional[str] = Field( - default=None, - alias="limitEventsPerSecond", - title=("Sets a limit on how many events get read from kafka per second.\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - partition: Optional[str] = Field(default=None, title="Partition name") - sasl: Optional[SASLConfig] = Field(default=None, title="SASL configuration for the kafka client\n+optional") - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the kafka client.\n+optional") - topic: Optional[str] = Field(default=None, title="Topic name") - url: Optional[str] = Field(default=None, title="URL to kafka cluster, multiple URLs separated by comma") - version: Optional[str] = Field( - default=None, - title=( - "Specify what kafka version is being connected to enables certain features" - " in sarama, defaults to 1.0.0\n+optional" - ), - ) +class MQTTEventSource(BaseModel): + client_id: Annotated[Optional[str], Field(alias="clientId", title="ClientID is the id of the client")] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + description="ConnectionBackoff holds backoff applied to connection.", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the mqtt client.\n+optional"), + ] = None + topic: Annotated[Optional[str], Field(title="Topic name")] = None + url: Annotated[Optional[str], Field(title="URL to connect to broker")] = None -class KafkaTrigger(BaseModel): - compress: Optional[bool] = Field( - default=None, - title=( - "Compress determines whether to compress message or not.\nDefaults to" - " false.\nIf set to true, compresses message using snappy" - " compression.\n+optional" - ), - ) - flush_frequency: Optional[int] = Field( - default=None, - alias="flushFrequency", - title=( - "FlushFrequency refers to the frequency in milliseconds to flush" - " batches.\nDefaults to 500 milliseconds.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=("Parameters is the list of parameters that is applied to resolved Kafka" " trigger object."), - ) - partition: Optional[int] = Field(default=None, description="Partition to write data to.") - partitioning_key: Optional[str] = Field( - default=None, - alias="partitioningKey", - description=( - "The partitioning key for the messages put on the Kafka topic.\nDefaults to" " broker url.\n+optional." - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - required_acks: Optional[int] = Field( - default=None, - alias="requiredAcks", - description=( - "RequiredAcks used in producer to tell the broker how many replica" - " acknowledgements\nDefaults to 1 (Only wait for the leader to" - " ack).\n+optional." - ), - ) - sasl: Optional[SASLConfig] = Field(default=None, title="SASL configuration for the kafka client\n+optional") - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the Kafka producer.\n+optional") - topic: Optional[str] = Field( - default=None, - title=("Name of the topic.\nMore info at" " https://kafka.apache.org/documentation/#intro_topics"), - ) - url: Optional[str] = Field( - default=None, - description="URL of the Kafka broker, multiple URLs separated by comma.", - ) - version: Optional[str] = Field( - default=None, - title=( - "Specify what kafka version is being connected to enables certain features" - " in sarama, defaults to 1.0.0\n+optional" - ), - ) +class NSQEventSource(BaseModel): + channel: Annotated[Optional[str], Field(title="Channel used for subscription")] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + host_address: Annotated[ + Optional[str], + Field( + alias="hostAddress", + title="HostAddress is the address of the host for NSQ lookup", + ), + ] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the nsq client.\n+optional"), + ] = None + topic: Annotated[Optional[str], Field(description="Topic to subscribe to.")] = None -class MQTTEventSource(BaseModel): - client_id: Optional[str] = Field(default=None, alias="clientId", title="ClientID is the id of the client") - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - description="ConnectionBackoff holds backoff applied to connection.", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the mqtt client.\n+optional") - topic: Optional[str] = Field(default=None, title="Topic name") - url: Optional[str] = Field(default=None, title="URL to connect to broker") +class PulsarEventSource(BaseModel): + auth_token_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="authTokenSecret", + title="Authentication token for the pulsar client.\n+optional", + ), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the pulsar client.\n+optional"), + ] = None + tls_allow_insecure_connection: Annotated[ + Optional[bool], + Field( + alias="tlsAllowInsecureConnection", + title=("Whether the Pulsar client accept untrusted TLS certificate from" " broker.\n+optional"), + ), + ] = None + tls_trust_certs_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="tlsTrustCertsSecret", + title="Trusted TLS certificate secret.\n+optional", + ), + ] = None + tls_validate_hostname: Annotated[ + Optional[bool], + Field( + alias="tlsValidateHostname", + title=("Whether the Pulsar client verify the validity of the host name from" " broker.\n+optional"), + ), + ] = None + topics: Annotated[ + Optional[List[str]], + Field(title="Name of the topics to subscribe to.\n+required"), + ] = None + type: Annotated[ + Optional[str], + Field( + title=( + 'Type of the subscription.\nOnly "exclusive" and "shared" is' + " supported.\nDefaults to exclusive.\n+optional" + ) + ), + ] = None + url: Annotated[ + Optional[str], + Field(title="Configure the service URL for the Pulsar service.\n+required"), + ] = None -class NATSEventsSource(BaseModel): - auth: Optional[NATSAuth] = Field(default=None, title="Auth information\n+optional") - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - description="ConnectionBackoff holds backoff applied to connection.", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - subject: Optional[str] = Field( - default=None, - title="Subject holds the name of the subject onto which messages are published", - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the nats client.\n+optional") - url: Optional[str] = Field(default=None, title="URL to connect to NATS cluster") +class PulsarTrigger(BaseModel): + auth_token_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="authTokenSecret", + title="Authentication token for the pulsar client.\n+optional", + ), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=("Parameters is the list of parameters that is applied to resolved Kafka" " trigger object.") + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the pulsar client.\n+optional"), + ] = None + tls_allow_insecure_connection: Annotated[ + Optional[bool], + Field( + alias="tlsAllowInsecureConnection", + title=("Whether the Pulsar client accept untrusted TLS certificate from" " broker.\n+optional"), + ), + ] = None + tls_trust_certs_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="tlsTrustCertsSecret", + title="Trusted TLS certificate secret.\n+optional", + ), + ] = None + tls_validate_hostname: Annotated[ + Optional[bool], + Field( + alias="tlsValidateHostname", + title=("Whether the Pulsar client verify the validity of the host name from" " broker.\n+optional"), + ), + ] = None + topic: Annotated[ + Optional[str], + Field(title=("Name of the topic.\nSee" " https://pulsar.apache.org/docs/en/concepts-messaging/")), + ] = None + url: Annotated[ + Optional[str], + Field(title="Configure the service URL for the Pulsar service.\n+required"), + ] = None -class NATSTrigger(BaseModel): - parameters: Optional[List[TriggerParameter]] = None - payload: Optional[List[TriggerParameter]] = None - subject: Optional[str] = Field(default=None, description="Name of the subject to put message on.") - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the NATS producer.\n+optional") - url: Optional[str] = Field(default=None, description="URL of the NATS cluster.") +class CalendarEventSource(BaseModel): + exclusion_dates: Annotated[ + Optional[List[str]], + Field( + alias="exclusionDates", + description=("ExclusionDates defines the list of DATE-TIME exceptions for recurring" " events."), + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + interval: Annotated[ + Optional[str], + Field(title=("Interval is a string that describes an interval duration, e.g. 1s," " 30m, 2h...\n+optional")), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + persistence: Annotated[ + Optional[EventPersistence], + Field(title="Persistence hold the configuration for event persistence"), + ] = None + schedule: Annotated[ + Optional[str], + Field( + title=( + "Schedule is a cron-like expression. For reference, see:" + " https://en.wikipedia.org/wiki/Cron\n+optional" + ) + ), + ] = None + timezone: Annotated[Optional[str], Field(title="Timezone in which to run the schedule\n+optional")] = None -class NSQEventSource(BaseModel): - channel: Optional[str] = Field(default=None, title="Channel used for subscription") - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - host_address: Optional[str] = Field( - default=None, - alias="hostAddress", - title="HostAddress is the address of the host for NSQ lookup", - ) - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the nsq client.\n+optional") - topic: Optional[str] = Field(default=None, description="Topic to subscribe to.") +class NATSEventsSource(BaseModel): + auth: Annotated[Optional[NATSAuth], Field(title="Auth information\n+optional")] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + description="ConnectionBackoff holds backoff applied to connection.", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + subject: Annotated[ + Optional[str], + Field(title=("Subject holds the name of the subject onto which messages are" " published")), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the nats client.\n+optional"), + ] = None + url: Annotated[Optional[str], Field(title="URL to connect to NATS cluster")] = None -class OpenWhiskTrigger(BaseModel): - action_name: Optional[str] = Field(default=None, alias="actionName", description="Name of the action/function.") - auth_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authToken", - title="AuthToken for authentication.\n+optional", - ) - host: Optional[str] = Field(default=None, description="Host URL of the OpenWhisk.") - namespace: Optional[str] = Field( - default=None, - description='Namespace for the action.\nDefaults to "_".\n+optional.', - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe trigger resource.\n+optional" - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - version: Optional[str] = Field(default=None, title="Version for the API.\nDefaults to v1.\n+optional") +class BitbucketEventSource(BaseModel): + auth: Annotated[ + Optional[BitbucketAuth], + Field(description="Auth information required to connect to Bitbucket."), + ] = None + delete_hook_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteHookOnFinish", + title=( + "DeleteHookOnFinish determines whether to delete the defined Bitbucket" + " hook once the event source is stopped.\n+optional" + ), + ), + ] = None + events: Annotated[Optional[List[str]], Field(description="Events this webhook is subscribed to.")] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=( + "Metadata holds the user defined metadata which will be passed along" " the event payload.\n+optional" + ) + ), + ] = None + owner: Annotated[ + Optional[str], + Field( + title=( + "DeprecatedOwner is the owner of the repository.\nDeprecated: use" + " Repositories instead. Will be unsupported in v1.9\n+optional" + ) + ), + ] = None + project_key: Annotated[ + Optional[str], + Field( + alias="projectKey", + title=( + "DeprecatedProjectKey is the key of the project to which the repository" + " relates\nDeprecated: use Repositories instead. Will be unsupported in" + " v1.9\n+optional" + ), + ), + ] = None + repositories: Annotated[ + Optional[List[BitbucketRepository]], + Field(title=("Repositories holds a list of repositories for which integration needs" " to set up\n+optional")), + ] = None + repository_slug: Annotated[ + Optional[str], + Field( + alias="repositorySlug", + title=( + "DeprecatedRepositorySlug is a URL-friendly version of a repository" + " name, automatically generated by Bitbucket for use in the" + " URL\nDeprecated: use Repositories instead. Will be unsupported in" + " v1.9\n+optional" + ), + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook refers to the configuration required to run an http server"), + ] = None -class PulsarEventSource(BaseModel): - auth_token_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authTokenSecret", - title="Authentication token for the pulsar client.\n+optional", - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the pulsar client.\n+optional") - tls_allow_insecure_connection: Optional[bool] = Field( - default=None, - alias="tlsAllowInsecureConnection", - title=("Whether the Pulsar client accept untrusted TLS certificate from" " broker.\n+optional"), - ) - tls_trust_certs_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="tlsTrustCertsSecret", - title="Trusted TLS certificate secret.\n+optional", - ) - tls_validate_hostname: Optional[bool] = Field( - default=None, - alias="tlsValidateHostname", - title=("Whether the Pulsar client verify the validity of the host name from" " broker.\n+optional"), - ) - topics: Optional[List[str]] = Field(default=None, title="Name of the topics to subscribe to.\n+required") - type: Optional[str] = Field( - default=None, - title=( - 'Type of the subscription.\nOnly "exclusive" and "shared" is' - " supported.\nDefaults to exclusive.\n+optional" - ), - ) - url: Optional[str] = Field( - default=None, - title="Configure the service URL for the Pulsar service.\n+required", - ) +class ArtifactLocation(BaseModel): + configmap: Annotated[ + Optional[v1_1.ConfigMapKeySelector], + Field(title="Configmap that stores the artifact"), + ] = None + file: Annotated[ + Optional[FileArtifact], + Field(title="File artifact is artifact stored in a file"), + ] = None + git: Annotated[Optional[GitArtifact], Field(title="Git repository hosting the artifact")] = None + inline: Annotated[ + Optional[str], + Field(title="Inline artifact is embedded in sensor spec as a string"), + ] = None + resource: Annotated[Optional[Resource], Field(title="Resource is generic template for K8s resource")] = None + s3: Annotated[Optional[S3Artifact], Field(title="S3 compliant artifact")] = None + url: Annotated[Optional[URLArtifact], Field(title="URL to fetch the artifact from")] = None -class PulsarTrigger(BaseModel): - auth_token_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authTokenSecret", - title="Authentication token for the pulsar client.\n+optional", - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=("Parameters is the list of parameters that is applied to resolved Kafka" " trigger object."), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the pulsar client.\n+optional") - tls_allow_insecure_connection: Optional[bool] = Field( - default=None, - alias="tlsAllowInsecureConnection", - title=("Whether the Pulsar client accept untrusted TLS certificate from" " broker.\n+optional"), - ) - tls_trust_certs_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="tlsTrustCertsSecret", - title="Trusted TLS certificate secret.\n+optional", - ) - tls_validate_hostname: Optional[bool] = Field( - default=None, - alias="tlsValidateHostname", - title=("Whether the Pulsar client verify the validity of the host name from" " broker.\n+optional"), - ) - topic: Optional[str] = Field( - default=None, - title=("Name of the topic.\nSee" " https://pulsar.apache.org/docs/en/concepts-messaging/"), - ) - url: Optional[str] = Field( - default=None, - title="Configure the service URL for the Pulsar service.\n+required", - ) +class TriggerPolicy(BaseModel): + k8s: Annotated[ + Optional[K8SResourcePolicy], + Field( + title=( + "K8SResourcePolicy refers to the policy used to check the state of K8s" + " based triggers using using labels" + ) + ), + ] = None + status: Annotated[ + Optional[StatusPolicy], + Field(title=("Status refers to the policy used to check the state of the trigger" " using response status")), + ] = None -class RedisEventSource(BaseModel): - channels: Optional[List[str]] = None - db: Optional[int] = Field( - default=None, - title="DB to use. If not specified, default DB 0 will be used.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - host_address: Optional[str] = Field( - default=None, - alias="hostAddress", - title="HostAddress refers to the address of the Redis host/server", - ) - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - namespace: Optional[str] = Field( - default=None, - title=( - "Namespace to use to retrieve the password from. It should only be" - " specified if password is declared\n+optional" - ), - ) - password: Optional[v1.SecretKeySelector] = Field( - default=None, title="Password required for authentication if any.\n+optional" - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the redis client.\n+optional") - username: Optional[str] = Field( - default=None, - title="Username required for ACL style authentication if any.\n+optional", - ) +class ArgoWorkflowTrigger(BaseModel): + args: Annotated[ + Optional[List[str]], + Field(title="Args is the list of arguments to pass to the argo CLI"), + ] = None + operation: Annotated[ + Optional[str], + Field( + title=( + "Operation refers to the type of operation performed on the argo" + " workflow resource.\nDefault value is Submit.\n+optional" + ) + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field(title=("Parameters is the list of parameters to pass to resolved Argo Workflow" " object")), + ] = None + source: Annotated[Optional[ArtifactLocation], Field(title="Source of the K8s resource file(s)")] = None -class RedisStreamEventSource(BaseModel): - consumer_group: Optional[str] = Field( - default=None, - alias="consumerGroup", - title=( - "ConsumerGroup refers to the Redis stream consumer group that will" - " be\ncreated on all redis streams. Messages are read through this group." - " Defaults to 'argo-events-cg'\n+optional" - ), - ) - db: Optional[int] = Field( - default=None, - title="DB to use. If not specified, default DB 0 will be used.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - host_address: Optional[str] = Field( - default=None, - alias="hostAddress", - title=("HostAddress refers to the address of the Redis host/server (master" " instance)"), - ) - max_msg_count_per_read: Optional[int] = Field( - default=None, - alias="maxMsgCountPerRead", - title=( - "MaxMsgCountPerRead holds the maximum number of messages per stream that" - " will be read in each XREADGROUP of all streams\nExample: if there are 2" - " streams and MaxMsgCountPerRead=10, then each XREADGROUP may read upto a" - " total of 20 messages.\nSame as COUNT option in" - " XREADGROUP(https://redis.io/topics/streams-intro). Defaults to" - " 10\n+optional" - ), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - password: Optional[v1.SecretKeySelector] = Field( - default=None, title="Password required for authentication if any.\n+optional" - ) - streams: Optional[List[str]] = Field( - default=None, - description=( - "Streams to look for entries. XREADGROUP is used on all streams using a" " single consumer group." - ), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the redis client.\n+optional") - username: Optional[str] = Field( - default=None, - title="Username required for ACL style authentication if any.\n+optional", - ) +class StandardK8STrigger(BaseModel): + live_object: Annotated[ + Optional[bool], + Field( + alias="liveObject", + title=( + "LiveObject specifies whether the resource should be directly fetched" + " from K8s instead\nof being marshaled from the resource artifact. If" + " set to true, the resource artifact\nmust contain the information" + " required to uniquely identify the resource in the cluster,\nthat is," + ' you must specify "apiVersion", "kind" as well as "name" and' + ' "namespace" meta\ndata.\nOnly valid for operation type' + " `update`\n+optional" + ), + ), + ] = None + operation: Annotated[ + Optional[str], + Field( + title=( + "Operation refers to the type of operation performed on the k8s" + " resource.\nDefault value is Create.\n+optional" + ) + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field(description=("Parameters is the list of parameters that is applied to resolved K8s" " trigger object.")), + ] = None + patch_strategy: Annotated[ + Optional[str], + Field( + alias="patchStrategy", + title=( + "PatchStrategy controls the K8s object patching strategy when the" + " trigger operation is specified as patch.\npossible" + ' values:\n"application/json-patch+json"\n"application/merge-patch+json"\n"application/strategic-merge-patch+json"\n"application/apply-patch+yaml".\nDefaults' + ' to "application/merge-patch+json"\n+optional' + ), + ), + ] = None + source: Annotated[Optional[ArtifactLocation], Field(title="Source of the K8s resource file(s)")] = None -class ResourceEventSource(BaseModel): - event_types: Optional[List[str]] = Field( - default=None, - alias="eventTypes", - description=( - "EventTypes is the list of event type to watch.\nPossible values are - ADD," " UPDATE and DELETE." - ), - ) - filter: Optional[ResourceFilter] = Field( - default=None, - title=( - "Filter is applied on the metadata of the resource\nIf you apply filter," - " then the internal event informer will only monitor objects that pass the" - " filter.\n+optional" - ), - ) - group_version_resource: Optional[v1_1.GroupVersionResource] = Field( - default=None, alias="groupVersionResource", title="Group of the resource" - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - namespace: Optional[str] = Field(default=None, title="Namespace where resource is deployed") +class Service(BaseModel): + cluster_ip: Annotated[ + Optional[str], + Field( + alias="clusterIP", + title=( + "clusterIP is the IP address of the service and is usually" + " assigned\nrandomly by the master. If an address is specified manually" + " and is not in\nuse by others, it will be allocated to the service;" + " otherwise, creation\nof the service will fail. This field can not be" + ' changed through updates.\nValid values are "None", empty string (""),' + ' or a valid IP address. "None"\ncan be specified for headless services' + " when proxying is not required.\nMore info:" + " https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies\n+optional" + ), + ), + ] = None + ports: Annotated[ + Optional[List[v1_1.ServicePort]], + Field( + title=( + "The list of ports that are exposed by this ClusterIP" + " service.\n+patchMergeKey=port\n+patchStrategy=merge\n+listType=map\n+listMapKey=port\n+listMapKey=protocol" + ) + ), + ] = None -class SNSEventSource(BaseModel): - access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKey", - title="AccessKey refers K8s secret containing aws access key", - ) - endpoint: Optional[str] = Field( - default=None, - title=("Endpoint configures connection to a specific SNS endpoint instead of" " Amazons servers\n+optional"), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - region: Optional[str] = Field(default=None, title="Region is AWS region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), - ) - secret_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKey", - title="SecretKey refers K8s secret containing aws secret key", - ) - topic_arn: Optional[str] = Field(default=None, alias="topicArn", title="TopicArn") - validate_signature: Optional[bool] = Field( - default=None, - alias="validateSignature", - title=("ValidateSignature is boolean that can be set to true for SNS signature" " verification\n+optional"), - ) - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook configuration for http server") +class Status(BaseModel): + conditions: Annotated[ + Optional[List[Condition]], + Field( + title=( + "Conditions are the latest available observations of a resource's" + " current state.\n+optional\n+patchMergeKey=type\n+patchStrategy=merge" + ) + ), + ] = None -class SecureHeader(BaseModel): - name: Optional[str] = None - value_from: Optional[ValueFromSource] = Field( - default=None, - alias="valueFrom", - title="Values can be read from either secrets or configmaps", - ) +class ExprFilter(BaseModel): + expr: Annotated[ + Optional[str], + Field(description=("Expr refers to the expression that determines the outcome of the" " filter.")), + ] = None + fields: Annotated[ + Optional[List[PayloadField]], + Field(description=("Fields refers to set of keys that refer to the paths within event" " payload.")), + ] = None -class SensorStatus(BaseModel): - status: Optional[Status] = None +class AWSLambdaTrigger(BaseModel): + access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessKey", + title="AccessKey refers K8s secret containing aws access key\n+optional", + ), + ] = None + function_name: Annotated[ + Optional[str], + Field( + alias="functionName", + description="FunctionName refers to the name of the function to invoke.", + ), + ] = None + invocation_type: Annotated[ + Optional[str], + Field( + alias="invocationType", + description=( + "Choose from the following options.\n\n * RequestResponse (default) -" + " Invoke the function synchronously. Keep\n the connection open until" + " the function returns a response or times out.\n The API response" + " includes the function response and additional data.\n\n * Event -" + " Invoke the function asynchronously. Send events that fail multiple\n " + " times to the function's dead-letter queue (if it's configured). The" + " API\n response only includes a status code.\n\n * DryRun -" + " Validate parameter values and verify that the user or role\n has" + " permission to invoke the function.\n+optional" + ), + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + title=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe trigger resource.\n+optional" + ) + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + region: Annotated[Optional[str], Field(title="Region is AWS region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), + ), + ] = None + secret_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="secretKey", + title="SecretKey refers K8s secret containing aws secret key\n+optional", + ), + ] = None -class Service(BaseModel): - cluster_ip: Optional[str] = Field( - default=None, - alias="clusterIP", - title=( - "clusterIP is the IP address of the service and is usually" - " assigned\nrandomly by the master. If an address is specified manually and" - " is not in\nuse by others, it will be allocated to the service; otherwise," - " creation\nof the service will fail. This field can not be changed through" - ' updates.\nValid values are "None", empty string (""), or a valid IP' - ' address. "None"\ncan be specified for headless services when proxying is' - " not required.\nMore info:" - " https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies\n+optional" - ), - ) - ports: Optional[List[v1.ServicePort]] = Field( - default=None, - title=( - "The list of ports that are exposed by this ClusterIP" - " service.\n+patchMergeKey=port\n+patchStrategy=merge\n+listType=map\n+listMapKey=port\n+listMapKey=protocol" - ), - ) +class AzureEventHubsTrigger(BaseModel): + fqdn: Annotated[ + Optional[str], + Field( + title=( + "FQDN refers to the namespace dns of Azure Event Hubs to be used i.e." + " .servicebus.windows.net" + ) + ), + ] = None + hub_name: Annotated[ + Optional[str], + Field( + alias="hubName", + title="HubName refers to the Azure Event Hub to send events to", + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + title=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe trigger resource.\n+optional" + ) + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + shared_access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sharedAccessKey", + title=("SharedAccessKey refers to a K8s secret containing the primary key" " for the"), + ), + ] = None + shared_access_key_name: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sharedAccessKeyName", + title="SharedAccessKeyName refers to the name of the Shared Access Key", + ), + ] = None -class SlackEventSource(BaseModel): - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - signing_secret: Optional[v1.SecretKeySelector] = Field( - default=None, alias="signingSecret", title="Slack App signing secret" - ) - token: Optional[v1.SecretKeySelector] = Field(default=None, title="Token for URL verification handshake") - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration for a REST endpoint") +class CustomTrigger(BaseModel): + cert_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="certSecret", + description=( + "CertSecret refers to the secret that contains cert for secure" + " connection between sensor and custom trigger gRPC server." + ), + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Parameters is the list of parameters that is applied to resolved" " custom trigger trigger object." + ) + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + secure: Annotated[ + Optional[bool], + Field(title=("Secure refers to type of the connection between sensor to custom" " trigger gRPC")), + ] = None + server_name_override: Annotated[ + Optional[str], + Field( + alias="serverNameOverride", + description=( + "ServerNameOverride for the secure connection between sensor and custom" " trigger gRPC server." + ), + ), + ] = None + server_url: Annotated[ + Optional[str], + Field( + alias="serverURL", + title=("ServerURL is the url of the gRPC server that executes custom trigger"), + ), + ] = None + spec: Annotated[ + Optional[Dict[str, str]], + Field( + description=( + "Spec is the custom trigger resource specification that custom trigger" + " gRPC server knows how to interpret." + ) + ), + ] = None -class SlackTrigger(BaseModel): - channel: Optional[str] = Field( - default=None, - title="Channel refers to which Slack channel to send slack message.\n+optional", - ) - message: Optional[str] = Field( - default=None, - title="Message refers to the message to send to the Slack channel.\n+optional", - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe trigger resource.\n+optional" - ), - ) - slack_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="slackToken", - description=( - "SlackToken refers to the Kubernetes secret that holds the slack token" " required to send messages." - ), - ) +class OpenWhiskTrigger(BaseModel): + action_name: Annotated[ + Optional[str], + Field(alias="actionName", description="Name of the action/function."), + ] = None + auth_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(alias="authToken", title="AuthToken for authentication.\n+optional"), + ] = None + host: Annotated[Optional[str], Field(description="Host URL of the OpenWhisk.")] = None + namespace: Annotated[ + Optional[str], + Field(description='Namespace for the action.\nDefaults to "_".\n+optional.'), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + title=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe trigger resource.\n+optional" + ) + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + version: Annotated[Optional[str], Field(title="Version for the API.\nDefaults to v1.\n+optional")] = None -class StorageGridEventSource(BaseModel): - api_url: Optional[str] = Field( - default=None, - alias="apiURL", - description="APIURL is the url of the storagegrid api.", - ) - auth_token: Optional[v1.SecretKeySelector] = Field( - default=None, alias="authToken", title="Auth token for storagegrid api" - ) - bucket: Optional[str] = Field(default=None, description="Name of the bucket to register notifications for.") - events: Optional[List[str]] = None - filter: Optional[StorageGridFilter] = Field( - default=None, description="Filter on object key which caused the notification." - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - region: Optional[str] = Field(default=None, title="S3 region.\nDefaults to us-east-1\n+optional") - topic_arn: Optional[str] = Field(default=None, alias="topicArn", title="TopicArn") - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration for a REST endpoint") +class SlackTrigger(BaseModel): + channel: Annotated[ + Optional[str], + Field(title=("Channel refers to which Slack channel to send slack" " message.\n+optional")), + ] = None + message: Annotated[ + Optional[str], + Field(title=("Message refers to the message to send to the Slack channel.\n+optional")), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + title=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe trigger resource.\n+optional" + ) + ), + ] = None + slack_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="slackToken", + description=( + "SlackToken refers to the Kubernetes secret that holds the slack token" " required to send messages." + ), + ), + ] = None -class StripeEventSource(BaseModel): - api_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="apiKey", - title=( - "APIKey refers to K8s secret that holds Stripe API key. Used only if" - " CreateWebhook is enabled.\n+optional" - ), - ) - create_webhook: Optional[bool] = Field( - default=None, - alias="createWebhook", - title=("CreateWebhook if specified creates a new webhook" " programmatically.\n+optional"), - ) - event_filter: Optional[List[str]] = Field( - default=None, - alias="eventFilter", - title=( - "EventFilter describes the type of events to listen to. If not specified," - " all types of events will be processed.\nMore info at" - " https://stripe.com/docs/api/events/list\n+optional" - ), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration for a REST endpoint") +class EventSourceStatus(BaseModel): + status: Optional[Status] = None -class ArtifactLocation(BaseModel): - configmap: Optional[v1.ConfigMapKeySelector] = Field(default=None, title="Configmap that stores the artifact") - file: Optional[FileArtifact] = Field(default=None, title="File artifact is artifact stored in a file") - git: Optional[GitArtifact] = Field(default=None, title="Git repository hosting the artifact") - inline: Optional[str] = Field(default=None, title="Inline artifact is embedded in sensor spec as a string") - resource: Optional[Resource] = Field(default=None, title="Resource is generic template for K8s resource") - s3: Optional[S3Artifact] = Field(default=None, title="S3 compliant artifact") - url: Optional[URLArtifact] = Field(default=None, title="URL to fetch the artifact from") +class SensorStatus(BaseModel): + status: Optional[Status] = None -class EventDependency(BaseModel): - event_name: Optional[str] = Field(default=None, alias="eventName", title="EventName is the name of the event") - event_source_name: Optional[str] = Field( - default=None, - alias="eventSourceName", - title="EventSourceName is the name of EventSource that Sensor depends on", - ) - filters: Optional[EventDependencyFilter] = Field( - default=None, - title=( - "Filters and rules governing toleration of success and constraints on the" " context and data of an event" - ), - ) - filters_logical_operator: Optional[str] = Field( - default=None, - alias="filtersLogicalOperator", - description=( - "FiltersLogicalOperator defines how different filters are evaluated" - " together.\nAvailable values: and (&&), or (||)\nIs optional and if left" - " blank treated as and (&&)." - ), - ) - name: Optional[str] = Field(default=None, title="Name is a unique name of this dependency") - transform: Optional[EventDependencyTransformer] = Field(default=None, title="Transform transforms the event data") +class EventDependencyFilter(BaseModel): + context: Annotated[Optional[EventContext], Field(title="Context filter constraints")] = None + data: Annotated[ + Optional[List[DataFilter]], + Field(title="Data filter constraints with escalation"), + ] = None + data_logical_operator: Annotated[ + Optional[str], + Field( + alias="dataLogicalOperator", + description=( + "DataLogicalOperator defines how multiple Data filters (if defined) are" + " evaluated together.\nAvailable values: and (&&), or (||)\nIs optional" + " and if left blank treated as and (&&)." + ), + ), + ] = None + expr_logical_operator: Annotated[ + Optional[str], + Field( + alias="exprLogicalOperator", + description=( + "ExprLogicalOperator defines how multiple Exprs filters (if defined)" + " are evaluated together.\nAvailable values: and (&&), or (||)\nIs" + " optional and if left blank treated as and (&&)." + ), + ), + ] = None + exprs: Annotated[ + Optional[List[ExprFilter]], + Field(description=("Exprs contains the list of expressions evaluated against the event" " payload.")), + ] = None + script: Annotated[ + Optional[str], + Field( + description=( + "Script refers to a Lua script evaluated to determine the validity of" + " an io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + time: Annotated[Optional[TimeFilter], Field(title="Time filter on the event with escalation")] = None class HTTPTrigger(BaseModel): - basic_auth: Optional[BasicAuth] = Field( - default=None, - alias="basicAuth", - title="BasicAuth configuration for the http request.\n+optional", - ) - headers: Optional[Dict[str, str]] = Field(default=None, title="Headers for the HTTP request.\n+optional") - method: Optional[str] = Field( - default=None, - title=( - "Method refers to the type of the HTTP request.\nRefer" - " https://golang.org/src/net/http/method.go for more" - " io.argoproj.workflow.v1alpha1.\nDefault value is POST.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe HTTP trigger resource." - ), - ) + basic_auth: Annotated[ + Optional[BasicAuth], + Field( + alias="basicAuth", + title="BasicAuth configuration for the http request.\n+optional", + ), + ] = None + headers: Annotated[ + Optional[Dict[str, str]], + Field(title="Headers for the HTTP request.\n+optional"), + ] = None + method: Annotated[ + Optional[str], + Field( + title=( + "Method refers to the type of the HTTP request.\nRefer" + " https://golang.org/src/net/http/method.go for more" + " io.argoproj.workflow.v1alpha1.\nDefault value is POST.\n+optional" + ) + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe HTTP trigger resource." + ) + ), + ] = None payload: Optional[List[TriggerParameter]] = None - secure_headers: Optional[List[SecureHeader]] = Field( - default=None, - alias="secureHeaders", - title=("Secure Headers stored in Kubernetes Secrets for the HTTP" " requests.\n+optional"), - ) - timeout: Optional[str] = Field( - default=None, - title=("Timeout refers to the HTTP request timeout in seconds.\nDefault value is" " 60 seconds.\n+optional"), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the HTTP client.\n+optional") - url: Optional[str] = Field(default=None, description="URL refers to the URL to send HTTP request to.") + secure_headers: Annotated[ + Optional[List[SecureHeader]], + Field( + alias="secureHeaders", + title=("Secure Headers stored in Kubernetes Secrets for the HTTP" " requests.\n+optional"), + ), + ] = None + timeout: Annotated[ + Optional[str], + Field( + title=( + "Timeout refers to the HTTP request timeout in seconds.\nDefault value" " is 60 seconds.\n+optional" + ) + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the HTTP client.\n+optional"), + ] = None + url: Annotated[ + Optional[str], + Field(description="URL refers to the URL to send HTTP request to."), + ] = None -class StandardK8STrigger(BaseModel): - live_object: Optional[bool] = Field( - default=None, - alias="liveObject", - title=( - "LiveObject specifies whether the resource should be directly fetched from" - " K8s instead\nof being marshaled from the resource artifact. If set to" - " true, the resource artifact\nmust contain the information required to" - " uniquely identify the resource in the cluster,\nthat is, you must specify" - ' "apiVersion", "kind" as well as "name" and "namespace" meta\ndata.\nOnly' - " valid for operation type `update`\n+optional" - ), - ) - operation: Optional[str] = Field( - default=None, - title=( - "Operation refers to the type of operation performed on the k8s" - " resource.\nDefault value is Create.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=("Parameters is the list of parameters that is applied to resolved K8s" " trigger object."), - ) - patch_strategy: Optional[str] = Field( - default=None, - alias="patchStrategy", - title=( - "PatchStrategy controls the K8s object patching strategy when the trigger" - " operation is specified as patch.\npossible" - ' values:\n"application/json-patch+json"\n"application/merge-patch+json"\n"application/strategic-merge-patch+json"\n"application/apply-patch+yaml".\nDefaults' - ' to "application/merge-patch+json"\n+optional' - ), - ) - source: Optional[ArtifactLocation] = Field(default=None, title="Source of the K8s resource file(s)") - - -class ArgoWorkflowTrigger(BaseModel): - args: Optional[List[str]] = Field(default=None, title="Args is the list of arguments to pass to the argo CLI") - operation: Optional[str] = Field( - default=None, - title=( - "Operation refers to the type of operation performed on the argo workflow" - " resource.\nDefault value is Submit.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=("Parameters is the list of parameters to pass to resolved Argo Workflow" " object"), - ) - source: Optional[ArtifactLocation] = Field(default=None, title="Source of the K8s resource file(s)") +class EventDependency(BaseModel): + event_name: Annotated[ + Optional[str], + Field(alias="eventName", title="EventName is the name of the event"), + ] = None + event_source_name: Annotated[ + Optional[str], + Field( + alias="eventSourceName", + title="EventSourceName is the name of EventSource that Sensor depends on", + ), + ] = None + filters: Annotated[ + Optional[EventDependencyFilter], + Field( + title=( + "Filters and rules governing toleration of success and constraints on" + " the context and data of an event" + ) + ), + ] = None + filters_logical_operator: Annotated[ + Optional[str], + Field( + alias="filtersLogicalOperator", + description=( + "FiltersLogicalOperator defines how different filters are evaluated" + " together.\nAvailable values: and (&&), or (||)\nIs optional and if" + " left blank treated as and (&&)." + ), + ), + ] = None + name: Annotated[Optional[str], Field(title="Name is a unique name of this dependency")] = None + transform: Annotated[ + Optional[EventDependencyTransformer], + Field(title="Transform transforms the event data"), + ] = None class TriggerTemplate(BaseModel): - argo_workflow: Optional[ArgoWorkflowTrigger] = Field( - default=None, - alias="argoWorkflow", - title=( - "ArgoWorkflow refers to the trigger that can perform various operations on" - " an Argo io.argoproj.workflow.v1alpha1.\n+optional" - ), - ) - aws_lambda: Optional[AWSLambdaTrigger] = Field( - default=None, - alias="awsLambda", - title=( - "AWSLambda refers to the trigger designed to invoke AWS Lambda function" - " with with on-the-fly constructable payload.\n+optional" - ), - ) - azure_event_hubs: Optional[AzureEventHubsTrigger] = Field( - default=None, - alias="azureEventHubs", - title=("AzureEventHubs refers to the trigger send an event to an Azure Event" " Hub.\n+optional"), - ) - conditions: Optional[str] = Field( - default=None, - title=( - 'Conditions is the conditions to execute the trigger.\nFor example: "(dep01' - ' || dep02) && dep04"\n+optional' - ), - ) - conditions_reset: Optional[List[ConditionsResetCriteria]] = Field( - default=None, - alias="conditionsReset", - title="Criteria to reset the conditons\n+optional", - ) - custom: Optional[CustomTrigger] = Field( - default=None, - title=( - "CustomTrigger refers to the trigger designed to connect to a gRPC trigger" - " server and execute a custom trigger.\n+optional" - ), - ) - http: Optional[HTTPTrigger] = Field( - default=None, - title=( - "HTTP refers to the trigger designed to dispatch a HTTP request with" - " on-the-fly constructable payload.\n+optional" - ), - ) - k8s: Optional[StandardK8STrigger] = Field( - default=None, - title=( - "StandardK8STrigger refers to the trigger designed to create or update a" - " generic Kubernetes resource.\n+optional" - ), - ) - kafka: Optional[KafkaTrigger] = Field( - default=None, - description=("Kafka refers to the trigger designed to place messages on Kafka" " topic.\n+optional."), - ) - log: Optional[LogTrigger] = Field( - default=None, - title=("Log refers to the trigger designed to invoke log the" " io.argoproj.workflow.v1alpha1.\n+optional"), - ) - name: Optional[str] = Field(default=None, description="Name is a unique name of the action to take.") - nats: Optional[NATSTrigger] = Field( - default=None, - description=("NATS refers to the trigger designed to place message on NATS" " subject.\n+optional."), - ) - open_whisk: Optional[OpenWhiskTrigger] = Field( - default=None, - alias="openWhisk", - title=("OpenWhisk refers to the trigger designed to invoke OpenWhisk" " action.\n+optional"), - ) - pulsar: Optional[PulsarTrigger] = Field( - default=None, - title=("Pulsar refers to the trigger designed to place messages on Pulsar" " topic.\n+optional"), - ) - slack: Optional[SlackTrigger] = Field( - default=None, - title=("Slack refers to the trigger designed to send slack notification" " message.\n+optional"), - ) + argo_workflow: Annotated[ + Optional[ArgoWorkflowTrigger], + Field( + alias="argoWorkflow", + title=( + "ArgoWorkflow refers to the trigger that can perform various operations" + " on an Argo io.argoproj.workflow.v1alpha1.\n+optional" + ), + ), + ] = None + aws_lambda: Annotated[ + Optional[AWSLambdaTrigger], + Field( + alias="awsLambda", + title=( + "AWSLambda refers to the trigger designed to invoke AWS Lambda function" + " with with on-the-fly constructable payload.\n+optional" + ), + ), + ] = None + azure_event_hubs: Annotated[ + Optional[AzureEventHubsTrigger], + Field( + alias="azureEventHubs", + title=("AzureEventHubs refers to the trigger send an event to an Azure Event" " Hub.\n+optional"), + ), + ] = None + conditions: Annotated[ + Optional[str], + Field( + title=( + "Conditions is the conditions to execute the trigger.\nFor example:" + ' "(dep01 || dep02) && dep04"\n+optional' + ) + ), + ] = None + conditions_reset: Annotated[ + Optional[List[ConditionsResetCriteria]], + Field(alias="conditionsReset", title="Criteria to reset the conditons\n+optional"), + ] = None + custom: Annotated[ + Optional[CustomTrigger], + Field( + title=( + "CustomTrigger refers to the trigger designed to connect to a gRPC" + " trigger server and execute a custom trigger.\n+optional" + ) + ), + ] = None + http: Annotated[ + Optional[HTTPTrigger], + Field( + title=( + "HTTP refers to the trigger designed to dispatch a HTTP request with" + " on-the-fly constructable payload.\n+optional" + ) + ), + ] = None + k8s: Annotated[ + Optional[StandardK8STrigger], + Field( + title=( + "StandardK8STrigger refers to the trigger designed to create or update" + " a generic Kubernetes resource.\n+optional" + ) + ), + ] = None + kafka: Annotated[ + Optional[KafkaTrigger], + Field(description=("Kafka refers to the trigger designed to place messages on Kafka" " topic.\n+optional.")), + ] = None + log: Annotated[ + Optional[LogTrigger], + Field( + title=("Log refers to the trigger designed to invoke log the" " io.argoproj.workflow.v1alpha1.\n+optional") + ), + ] = None + name: Annotated[Optional[str], Field(description="Name is a unique name of the action to take.")] = None + nats: Annotated[ + Optional[NATSTrigger], + Field(description=("NATS refers to the trigger designed to place message on NATS" " subject.\n+optional.")), + ] = None + open_whisk: Annotated[ + Optional[OpenWhiskTrigger], + Field( + alias="openWhisk", + title=("OpenWhisk refers to the trigger designed to invoke OpenWhisk" " action.\n+optional"), + ), + ] = None + pulsar: Annotated[ + Optional[PulsarTrigger], + Field(title=("Pulsar refers to the trigger designed to place messages on Pulsar" " topic.\n+optional")), + ] = None + slack: Annotated[ + Optional[SlackTrigger], + Field(title=("Slack refers to the trigger designed to send slack notification" " message.\n+optional")), + ] = None -class Template(BaseModel): - affinity: Optional[v1.Affinity] = Field( - default=None, title="If specified, the pod's scheduling constraints\n+optional" - ) - container: Optional[v1.Container] = Field( - default=None, - title=("Container is the main container image to run in the sensor pod\n+optional"), - ) - image_pull_secrets: Optional[List[v1.LocalObjectReference]] = Field( - default=None, - alias="imagePullSecrets", - title=( - "ImagePullSecrets is an optional list of references to secrets in the same" - " namespace to use for pulling any of the images used by this PodSpec.\nIf" - " specified, these secrets will be passed to individual puller" - " implementations for them to use. For example,\nin the case of docker," - " only DockerConfig type secrets are honored.\nMore info:" - " https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod\n+optional\n+patchMergeKey=name\n+patchStrategy=merge" - ), - ) - metadata: Optional[Metadata] = Field( - default=None, - title="Metadata sets the pods's metadata, i.e. annotations and labels", - ) - node_selector: Optional[Dict[str, str]] = Field( - default=None, - alias="nodeSelector", - title=( - "NodeSelector is a selector which must be true for the pod to fit on a" - " node.\nSelector which must match a node's labels for the pod to be" - " scheduled on that node.\nMore info:" - " https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\n+optional" - ), - ) - priority: Optional[int] = Field( - default=None, - title=( - "The priority value. Various system components use this field to find" - " the\npriority of the EventSource pod. When Priority Admission Controller" - " is enabled,\nit prevents users from setting this field. The admission" - " controller populates\nthis field from PriorityClassName.\nThe higher the" - " value, the higher the priority.\nMore info:" - " https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/\n+optional" - ), - ) - priority_class_name: Optional[str] = Field( - default=None, - alias="priorityClassName", - title=( - "If specified, indicates the EventSource pod's priority." - ' "system-node-critical"\nand "system-cluster-critical" are two special' - " keywords which indicate the\nhighest priorities with the former being the" - " highest priority. Any other\nname must be defined by creating a" - " PriorityClass object with that name.\nIf not specified, the pod priority" - " will be default or zero if there is no\ndefault.\nMore info:" - " https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/\n+optional" - ), - ) - security_context: Optional[v1.PodSecurityContext] = Field( - default=None, - alias="securityContext", - title=( - "SecurityContext holds pod-level security attributes and common container" - " settings.\nOptional: Defaults to empty. See type description for default" - " values of each field.\n+optional" - ), - ) - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - title=( - "ServiceAccountName is the name of the ServiceAccount to use to run sensor" - " pod.\nMore info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\n+optional" - ), - ) - tolerations: Optional[List[v1.Toleration]] = Field( - default=None, title="If specified, the pod's tolerations.\n+optional" - ) - volumes: Optional[List[v1.Volume]] = Field( - default=None, - title=( - "Volumes is a list of volumes that can be mounted by containers in a" - " io.argoproj.workflow.v1alpha1.\n+patchStrategy=merge\n+patchMergeKey=name\n+optional" - ), - ) +class Trigger(BaseModel): + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field(title=("Parameters is the list of parameters applied to the trigger template" " definition")), + ] = None + policy: Annotated[ + Optional[TriggerPolicy], + Field(title=("Policy to configure backoff and execution criteria for the" " trigger\n+optional")), + ] = None + rate_limit: Annotated[ + Optional[RateLimit], + Field(alias="rateLimit", title="Rate limit, default unit is Second\n+optional"), + ] = None + retry_strategy: Annotated[ + Optional[Backoff], + Field( + alias="retryStrategy", + title="Retry strategy, defaults to no retry\n+optional", + ), + ] = None + template: Annotated[ + Optional[TriggerTemplate], + Field(description="Template describes the trigger specification."), + ] = None -class Trigger(BaseModel): - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=("Parameters is the list of parameters applied to the trigger template" " definition"), - ) - policy: Optional[TriggerPolicy] = Field( - default=None, - title=("Policy to configure backoff and execution criteria for the" " trigger\n+optional"), - ) - rate_limit: Optional[RateLimit] = Field( - default=None, - alias="rateLimit", - title="Rate limit, default unit is Second\n+optional", - ) - retry_strategy: Optional[Backoff] = Field( - default=None, - alias="retryStrategy", - title="Retry strategy, defaults to no retry\n+optional", - ) - template: Optional[TriggerTemplate] = Field( - default=None, description="Template describes the trigger specification." - ) +class Template(BaseModel): + affinity: Annotated[ + Optional[v1_1.Affinity], + Field(title="If specified, the pod's scheduling constraints\n+optional"), + ] = None + container: Annotated[ + Optional[v1_1.Container], + Field(title=("Container is the main container image to run in the sensor" " pod\n+optional")), + ] = None + image_pull_secrets: Annotated[ + Optional[List[v1_1.LocalObjectReference]], + Field( + alias="imagePullSecrets", + title=( + "ImagePullSecrets is an optional list of references to secrets in the" + " same namespace to use for pulling any of the images used by this" + " PodSpec.\nIf specified, these secrets will be passed to individual" + " puller implementations for them to use. For example,\nin the case of" + " docker, only DockerConfig type secrets are honored.\nMore info:" + " https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod\n+optional\n+patchMergeKey=name\n+patchStrategy=merge" + ), + ), + ] = None + metadata: Annotated[ + Optional[Metadata], + Field(title="Metadata sets the pods's metadata, i.e. annotations and labels"), + ] = None + node_selector: Annotated[ + Optional[Dict[str, str]], + Field( + alias="nodeSelector", + title=( + "NodeSelector is a selector which must be true for the pod to fit on a" + " node.\nSelector which must match a node's labels for the pod to be" + " scheduled on that node.\nMore info:" + " https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\n+optional" + ), + ), + ] = None + priority: Annotated[ + Optional[int], + Field( + title=( + "The priority value. Various system components use this field to find" + " the\npriority of the EventSource pod. When Priority Admission" + " Controller is enabled,\nit prevents users from setting this field." + " The admission controller populates\nthis field from" + " PriorityClassName.\nThe higher the value, the higher the" + " priority.\nMore info:" + " https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/\n+optional" + ) + ), + ] = None + priority_class_name: Annotated[ + Optional[str], + Field( + alias="priorityClassName", + title=( + "If specified, indicates the EventSource pod's priority." + ' "system-node-critical"\nand "system-cluster-critical" are two special' + " keywords which indicate the\nhighest priorities with the former being" + " the highest priority. Any other\nname must be defined by creating a" + " PriorityClass object with that name.\nIf not specified, the pod" + " priority will be default or zero if there is no\ndefault.\nMore info:" + " https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/\n+optional" + ), + ), + ] = None + security_context: Annotated[ + Optional[v1_1.PodSecurityContext], + Field( + alias="securityContext", + title=( + "SecurityContext holds pod-level security attributes and common" + " container settings.\nOptional: Defaults to empty. See type" + " description for default values of each field.\n+optional" + ), + ), + ] = None + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + title=( + "ServiceAccountName is the name of the ServiceAccount to use to run" + " sensor pod.\nMore info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\n+optional" + ), + ), + ] = None + tolerations: Annotated[ + Optional[List[v1_1.Toleration]], + Field(title="If specified, the pod's tolerations.\n+optional"), + ] = None + volumes: Annotated[ + Optional[List[v1_1.Volume]], + Field( + title=( + "Volumes is a list of volumes that can be mounted by containers in a" + " io.argoproj.workflow.v1alpha1.\n+patchStrategy=merge\n+patchMergeKey=name\n+optional" + ) + ), + ] = None class EventSourceSpec(BaseModel): - amqp: Optional[Dict[str, AMQPEventSource]] = Field(default=None, title="AMQP event sources") - azure_events_hub: Optional[Dict[str, AzureEventsHubEventSource]] = Field( - default=None, alias="azureEventsHub", title="AzureEventsHub event sources" - ) - bitbucket: Optional[Dict[str, BitbucketEventSource]] = Field(default=None, title="Bitbucket event sources") - bitbucketserver: Optional[Dict[str, BitbucketServerEventSource]] = Field( - default=None, title="Bitbucket Server event sources" - ) - calendar: Optional[Dict[str, CalendarEventSource]] = Field(default=None, title="Calendar event sources") - emitter: Optional[Dict[str, EmitterEventSource]] = Field(default=None, title="Emitter event source") - event_bus_name: Optional[str] = Field( - default=None, - alias="eventBusName", - title=("EventBusName references to a EventBus name. By default the value is" ' "default"'), - ) - file: Optional[Dict[str, FileEventSource]] = Field(default=None, title="File event sources") - generic: Optional[Dict[str, GenericEventSource]] = Field(default=None, title="Generic event source") - github: Optional[Dict[str, GithubEventSource]] = Field(default=None, title="Github event sources") - gitlab: Optional[Dict[str, GitlabEventSource]] = Field(default=None, title="Gitlab event sources") - hdfs: Optional[Dict[str, HDFSEventSource]] = Field(default=None, title="HDFS event sources") - kafka: Optional[Dict[str, KafkaEventSource]] = Field(default=None, title="Kafka event sources") - minio: Optional[Dict[str, S3Artifact]] = Field(default=None, title="Minio event sources") - mqtt: Optional[Dict[str, MQTTEventSource]] = Field(default=None, title="MQTT event sources") - nats: Optional[Dict[str, NATSEventsSource]] = Field(default=None, title="NATS event sources") - nsq: Optional[Dict[str, NSQEventSource]] = Field(default=None, title="NSQ event source") - pub_sub: Optional[Dict[str, PubSubEventSource]] = Field(default=None, alias="pubSub", title="PubSub event sources") - pulsar: Optional[Dict[str, PulsarEventSource]] = Field(default=None, title="Pulsar event source") - redis: Optional[Dict[str, RedisEventSource]] = Field(default=None, title="Redis event source") - redis_stream: Optional[Dict[str, RedisStreamEventSource]] = Field( - default=None, alias="redisStream", title="Redis stream source" - ) - replicas: Optional[int] = Field(default=None, title="Replicas is the event source deployment replicas") - resource: Optional[Dict[str, ResourceEventSource]] = Field(default=None, title="Resource event sources") - service: Optional[Service] = Field( - default=None, - title=("Service is the specifications of the service to expose the event" " source\n+optional"), - ) - slack: Optional[Dict[str, SlackEventSource]] = Field(default=None, title="Slack event sources") - sns: Optional[Dict[str, SNSEventSource]] = Field(default=None, title="SNS event sources") - sqs: Optional[Dict[str, SQSEventSource]] = Field(default=None, title="SQS event sources") - storage_grid: Optional[Dict[str, StorageGridEventSource]] = Field( - default=None, alias="storageGrid", title="StorageGrid event sources" - ) - stripe: Optional[Dict[str, StripeEventSource]] = Field(default=None, title="Stripe event sources") - template: Optional[Template] = Field( - default=None, - title="Template is the pod specification for the event source\n+optional", - ) - webhook: Optional[Dict[str, WebhookEventSource]] = Field(default=None, title="Webhook event sources") + amqp: Annotated[Optional[Dict[str, AMQPEventSource]], Field(title="AMQP event sources")] = None + azure_events_hub: Annotated[ + Optional[Dict[str, AzureEventsHubEventSource]], + Field(alias="azureEventsHub", title="AzureEventsHub event sources"), + ] = None + bitbucket: Annotated[ + Optional[Dict[str, BitbucketEventSource]], + Field(title="Bitbucket event sources"), + ] = None + bitbucketserver: Annotated[ + Optional[Dict[str, BitbucketServerEventSource]], + Field(title="Bitbucket Server event sources"), + ] = None + calendar: Annotated[Optional[Dict[str, CalendarEventSource]], Field(title="Calendar event sources")] = None + emitter: Annotated[Optional[Dict[str, EmitterEventSource]], Field(title="Emitter event source")] = None + event_bus_name: Annotated[ + Optional[str], + Field( + alias="eventBusName", + title=("EventBusName references to a EventBus name. By default the value is" ' "default"'), + ), + ] = None + file: Annotated[Optional[Dict[str, FileEventSource]], Field(title="File event sources")] = None + generic: Annotated[Optional[Dict[str, GenericEventSource]], Field(title="Generic event source")] = None + github: Annotated[Optional[Dict[str, GithubEventSource]], Field(title="Github event sources")] = None + gitlab: Annotated[Optional[Dict[str, GitlabEventSource]], Field(title="Gitlab event sources")] = None + hdfs: Annotated[Optional[Dict[str, HDFSEventSource]], Field(title="HDFS event sources")] = None + kafka: Annotated[Optional[Dict[str, KafkaEventSource]], Field(title="Kafka event sources")] = None + minio: Annotated[Optional[Dict[str, S3Artifact]], Field(title="Minio event sources")] = None + mqtt: Annotated[Optional[Dict[str, MQTTEventSource]], Field(title="MQTT event sources")] = None + nats: Annotated[Optional[Dict[str, NATSEventsSource]], Field(title="NATS event sources")] = None + nsq: Annotated[Optional[Dict[str, NSQEventSource]], Field(title="NSQ event source")] = None + pub_sub: Annotated[ + Optional[Dict[str, PubSubEventSource]], + Field(alias="pubSub", title="PubSub event sources"), + ] = None + pulsar: Annotated[Optional[Dict[str, PulsarEventSource]], Field(title="Pulsar event source")] = None + redis: Annotated[Optional[Dict[str, RedisEventSource]], Field(title="Redis event source")] = None + redis_stream: Annotated[ + Optional[Dict[str, RedisStreamEventSource]], + Field(alias="redisStream", title="Redis stream source"), + ] = None + replicas: Annotated[Optional[int], Field(title="Replicas is the event source deployment replicas")] = None + resource: Annotated[Optional[Dict[str, ResourceEventSource]], Field(title="Resource event sources")] = None + service: Annotated[ + Optional[Service], + Field(title=("Service is the specifications of the service to expose the event" " source\n+optional")), + ] = None + slack: Annotated[Optional[Dict[str, SlackEventSource]], Field(title="Slack event sources")] = None + sns: Annotated[Optional[Dict[str, SNSEventSource]], Field(title="SNS event sources")] = None + sqs: Annotated[Optional[Dict[str, SQSEventSource]], Field(title="SQS event sources")] = None + storage_grid: Annotated[ + Optional[Dict[str, StorageGridEventSource]], + Field(alias="storageGrid", title="StorageGrid event sources"), + ] = None + stripe: Annotated[Optional[Dict[str, StripeEventSource]], Field(title="Stripe event sources")] = None + template: Annotated[ + Optional[Template], + Field(title="Template is the pod specification for the event source\n+optional"), + ] = None + webhook: Annotated[Optional[Dict[str, WebhookEventSource]], Field(title="Webhook event sources")] = None class SensorSpec(BaseModel): - dependencies: Optional[List[EventDependency]] = Field( - default=None, - description=("Dependencies is a list of the events that this sensor is dependent on."), - ) - error_on_failed_round: Optional[bool] = Field( - default=None, - alias="errorOnFailedRound", - description=( - "ErrorOnFailedRound if set to true, marks sensor state as `error` if the" - " previous trigger round fails.\nOnce sensor state is set to `error`, no" - " further triggers will be processed." - ), - ) - event_bus_name: Optional[str] = Field( - default=None, - alias="eventBusName", - title=("EventBusName references to a EventBus name. By default the value is" ' "default"'), - ) - replicas: Optional[int] = Field(default=None, title="Replicas is the sensor deployment replicas") - template: Optional[Template] = Field( - default=None, - title="Template is the pod specification for the sensor\n+optional", - ) - triggers: Optional[List[Trigger]] = Field( - default=None, - description=( - "Triggers is a list of the things that this sensor evokes. These are the" " outputs from this sensor." - ), - ) + dependencies: Annotated[ + Optional[List[EventDependency]], + Field(description=("Dependencies is a list of the events that this sensor is dependent on.")), + ] = None + error_on_failed_round: Annotated[ + Optional[bool], + Field( + alias="errorOnFailedRound", + description=( + "ErrorOnFailedRound if set to true, marks sensor state as `error` if" + " the previous trigger round fails.\nOnce sensor state is set to" + " `error`, no further triggers will be processed." + ), + ), + ] = None + event_bus_name: Annotated[ + Optional[str], + Field( + alias="eventBusName", + title=("EventBusName references to a EventBus name. By default the value is" ' "default"'), + ), + ] = None + replicas: Annotated[Optional[int], Field(title="Replicas is the sensor deployment replicas")] = None + template: Annotated[ + Optional[Template], + Field(title="Template is the pod specification for the sensor\n+optional"), + ] = None + triggers: Annotated[ + Optional[List[Trigger]], + Field( + description=( + "Triggers is a list of the things that this sensor evokes. These are" " the outputs from this sensor." + ) + ), + ] = None class EventSource(BaseModel): - metadata: Optional[v1_1.ObjectMeta] = None + metadata: Optional[v1.ObjectMeta] = None spec: Optional[EventSourceSpec] = None - status: Optional[EventSourceStatus] = Field(default=None, title="+optional") - - -class EventSourceList(BaseModel): - items: Optional[List[EventSource]] = None - metadata: Optional[v1_1.ListMeta] = None + status: Annotated[Optional[EventSourceStatus], Field(title="+optional")] = None class Sensor(BaseModel): - metadata: Optional[v1_1.ObjectMeta] = None + metadata: Optional[v1.ObjectMeta] = None spec: Optional[SensorSpec] = None - status: Optional[SensorStatus] = Field(default=None, title="+optional") + status: Annotated[Optional[SensorStatus], Field(title="+optional")] = None + + +class EventSourceList(BaseModel): + items: Optional[List[EventSource]] = None + metadata: Optional[v1.ListMeta] = None class SensorList(BaseModel): items: Optional[List[Sensor]] = None - metadata: Optional[v1_1.ListMeta] = None + metadata: Optional[v1.ListMeta] = None diff --git a/src/hera/events/models/io/argoproj/workflow/v1alpha1.py b/src/hera/events/models/io/argoproj/workflow/v1alpha1.py index f3d46ad52..6d0a2c828 100644 --- a/src/hera/events/models/io/argoproj/workflow/v1alpha1.py +++ b/src/hera/events/models/io/argoproj/workflow/v1alpha1.py @@ -5,6 +5,8 @@ from typing import Any, Dict, List, Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from ...k8s.api.core import v1 @@ -14,7 +16,28 @@ class Amount(BaseModel): - __root__: float = Field(..., description="Amount represent a numeric amount.") + __root__: Annotated[float, Field(description="Amount represent a numeric amount.")] + + +class NoneStrategy(BaseModel): + pass + + +class TarStrategy(BaseModel): + compression_level: Annotated[ + Optional[int], + Field( + alias="compressionLevel", + description=( + "CompressionLevel specifies the gzip compression level to use for the" + " artifact. Defaults to gzip.DefaultCompression." + ), + ), + ] = None + + +class ZipStrategy(BaseModel): + pass class ArchivedWorkflowDeletedResponse(BaseModel): @@ -22,59 +45,83 @@ class ArchivedWorkflowDeletedResponse(BaseModel): class ArtGCStatus(BaseModel): - not_specified: Optional[bool] = Field( - default=None, - alias="notSpecified", - description=("if this is true, we already checked to see if we need to do it and we" " don't"), - ) - pods_recouped: Optional[Dict[str, bool]] = Field( - default=None, - alias="podsRecouped", - description=( - "have completed Pods been processed? (mapped by Pod name) used to prevent" - " re-processing the Status of a Pod more than once" - ), - ) - strategies_processed: Optional[Dict[str, bool]] = Field( - default=None, - alias="strategiesProcessed", - description=( - "have Pods been started to perform this strategy? (enables us not to" - " re-process what we've already done)" - ), - ) + not_specified: Annotated[ + Optional[bool], + Field( + alias="notSpecified", + description=("if this is true, we already checked to see if we need to do it and we" " don't"), + ), + ] = None + pods_recouped: Annotated[ + Optional[Dict[str, bool]], + Field( + alias="podsRecouped", + description=( + "have completed Pods been processed? (mapped by Pod name) used to" + " prevent re-processing the Status of a Pod more than once" + ), + ), + ] = None + strategies_processed: Annotated[ + Optional[Dict[str, bool]], + Field( + alias="strategiesProcessed", + description=( + "have Pods been started to perform this strategy? (enables us not to" + " re-process what we've already done)" + ), + ), + ] = None + + +class RawArtifact(BaseModel): + data: Annotated[str, Field(description="Data is the string contents of the artifact")] + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None class ArtifactRepositoryRef(BaseModel): - config_map: Optional[str] = Field( - default=None, - alias="configMap", - description='The name of the config map. Defaults to "artifact-repositories".', - ) - key: Optional[str] = Field( - default=None, - description=( - "The config map key. Defaults to the value of the" - ' "workflows.argoproj.io/default-artifact-repository" annotation.' + config_map: Annotated[ + Optional[str], + Field( + alias="configMap", + description=('The name of the config map. Defaults to "artifact-repositories".'), + ), + ] = None + key: Annotated[ + Optional[str], + Field( + description=( + "The config map key. Defaults to the value of the" + ' "workflows.argoproj.io/default-artifact-repository" annotation.' + ) ), - ) + ] = None class ArtifactResult(BaseModel): - error: Optional[str] = Field( - default=None, - description=("Error is an optional error message which should be set if Success==false"), - ) - name: str = Field(..., description="Name is the name of the Artifact") - success: Optional[bool] = Field(default=None, description="Success describes whether the deletion succeeded") + error: Annotated[ + Optional[str], + Field(description=("Error is an optional error message which should be set if" " Success==false")), + ] = None + name: Annotated[str, Field(description="Name is the name of the Artifact")] + success: Annotated[ + Optional[bool], + Field(description="Success describes whether the deletion succeeded"), + ] = None class ArtifactResultNodeStatus(BaseModel): - artifact_results: Optional[Dict[str, ArtifactResult]] = Field( - default=None, - alias="artifactResults", - description="ArtifactResults maps Artifact name to result of the deletion", - ) + artifact_results: Annotated[ + Optional[Dict[str, ArtifactResult]], + Field( + alias="artifactResults", + description="ArtifactResults maps Artifact name to result of the deletion", + ), + ] = None class ClusterWorkflowTemplateDeleteResponse(BaseModel): @@ -90,9 +137,9 @@ class CollectEventResponse(BaseModel): class Condition(BaseModel): - message: Optional[str] = Field(default=None, description="Message is the condition message") - status: Optional[str] = Field(default=None, description="Status is the status of the condition") - type: Optional[str] = Field(default=None, description="Type is the type of condition") + message: Annotated[Optional[str], Field(description="Message is the condition message")] = None + status: Annotated[Optional[str], Field(description="Status is the status of the condition")] = None + type: Annotated[Optional[str], Field(description="Type is the type of condition")] = None class ContinueOn(BaseModel): @@ -101,15 +148,14 @@ class ContinueOn(BaseModel): class Counter(BaseModel): - value: str = Field(..., description="Value is the value of the metric") + value: Annotated[str, Field(description="Value is the value of the metric")] class CreateS3BucketOptions(BaseModel): - object_locking: Optional[bool] = Field( - default=None, - alias="objectLocking", - description="ObjectLocking Enable object locking", - ) + object_locking: Annotated[ + Optional[bool], + Field(alias="objectLocking", description="ObjectLocking Enable object locking"), + ] = None class CronWorkflowDeletedResponse(BaseModel): @@ -126,14 +172,33 @@ class CronWorkflowSuspendRequest(BaseModel): namespace: Optional[str] = None +class TemplateRef(BaseModel): + cluster_scope: Annotated[ + Optional[bool], + Field( + alias="clusterScope", + description=( + "ClusterScope indicates the referred template is cluster scoped (i.e. a" " ClusterWorkflowTemplate)." + ), + ), + ] = None + name: Annotated[Optional[str], Field(description="Name is the resource name of the template.")] = None + template: Annotated[ + Optional[str], + Field(description="Template is the name of referred template in the resource."), + ] = None + + class Event(BaseModel): - selector: str = Field( - ..., - description=( - "Selector (https://github.com/antonmedv/expr) that we must must match the" - ' io.argoproj.workflow.v1alpha1. E.g. `payload.message == "test"`' + selector: Annotated[ + str, + Field( + description=( + "Selector (https://github.com/antonmedv/expr) that we must must match" + ' the io.argoproj.workflow.v1alpha1. E.g. `payload.message == "test"`' + ) ), - ) + ] class EventResponse(BaseModel): @@ -141,25 +206,27 @@ class EventResponse(BaseModel): class ExecutorConfig(BaseModel): - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - description=("ServiceAccountName specifies the service account name of the executor" " container."), - ) + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + description=("ServiceAccountName specifies the service account name of the executor" " container."), + ), + ] = None class Gauge(BaseModel): - realtime: bool = Field(..., description="Realtime emits this metric in real time if applicable") - value: str = Field(..., description="Value is the value of the metric") + realtime: Annotated[bool, Field(description="Realtime emits this metric in real time if applicable")] + value: Annotated[str, Field(description="Value is the value of the metric")] class GetUserInfoResponse(BaseModel): email: Optional[str] = None - email_verified: Optional[bool] = Field(default=None, alias="emailVerified") + email_verified: Annotated[Optional[bool], Field(alias="emailVerified")] = None groups: Optional[List[str]] = None issuer: Optional[str] = None - service_account_name: Optional[str] = Field(default=None, alias="serviceAccountName") - service_account_namespace: Optional[str] = Field(default=None, alias="serviceAccountNamespace") + service_account_name: Annotated[Optional[str], Field(alias="serviceAccountName")] = None + service_account_namespace: Annotated[Optional[str], Field(alias="serviceAccountNamespace")] = None subject: Optional[str] = None @@ -168,23 +235,28 @@ class HTTPBodySource(BaseModel): class Header(BaseModel): - name: str = Field(..., description="Name is the header name") - value: str = Field(..., description="Value is the literal value to use for the header") + name: Annotated[str, Field(description="Name is the header name")] + value: Annotated[str, Field(description="Value is the literal value to use for the header")] class Histogram(BaseModel): - buckets: List[Amount] = Field(..., description="Buckets is a list of bucket divisors for the histogram") - value: str = Field(..., description="Value is the value of the metric") + buckets: Annotated[ + List[Amount], + Field(description="Buckets is a list of bucket divisors for the histogram"), + ] + value: Annotated[str, Field(description="Value is the value of the metric")] class Item(BaseModel): - __root__: Any = Field( - ..., - description=( - "Item expands a single workflow step into multiple parallel steps The value" - " of Item can be a map, string, bool, or number" + __root__: Annotated[ + Any, + Field( + description=( + "Item expands a single workflow step into multiple parallel steps The" + " value of Item can be a map, string, bool, or number" + ) ), - ) + ] class LabelKeys(BaseModel): @@ -200,43 +272,45 @@ class LabelValues(BaseModel): class Link(BaseModel): - name: str = Field(..., description='The name of the link, E.g. "Workflow Logs" or "Pod Logs"') - scope: str = Field( - ..., - description=('"workflow", "pod", "pod-logs", "event-source-logs", "sensor-logs" or' ' "chat"'), - ) - url: str = Field( - ..., - description=( - 'The URL. Can contain "${metadata.namespace}", "${metadata.name}",' - ' "${status.startedAt}", "${status.finishedAt}" or any other element in' - " workflow yaml, e.g." - ' "${io.argoproj.workflow.v1alpha1.metadata.annotations.userDefinedKey}"' - ), - ) + name: Annotated[ + str, + Field(description='The name of the link, E.g. "Workflow Logs" or "Pod Logs"'), + ] + scope: Annotated[ + str, + Field(description=('"workflow", "pod", "pod-logs", "event-source-logs", "sensor-logs" or' ' "chat"')), + ] + url: Annotated[ + str, + Field( + description=( + 'The URL. Can contain "${metadata.namespace}", "${metadata.name}",' + ' "${status.startedAt}", "${status.finishedAt}" or any other element in' + " workflow yaml, e.g." + ' "${io.argoproj.workflow.v1alpha1.metadata.annotations.userDefinedKey}"' + ) + ), + ] class LogEntry(BaseModel): content: Optional[str] = None - pod_name: Optional[str] = Field(default=None, alias="podName") + pod_name: Annotated[Optional[str], Field(alias="podName")] = None class MemoizationStatus(BaseModel): - cache_name: str = Field( - ..., - alias="cacheName", - description="Cache is the name of the cache that was used", - ) - hit: bool = Field( - ..., - description="Hit indicates whether this node was created from a cache entry", - ) - key: str = Field(..., description="Key is the name of the key used for this node's cache") - - -class Metadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None + cache_name: Annotated[ + str, + Field( + alias="cacheName", + description="Cache is the name of the cache that was used", + ), + ] + hit: Annotated[ + bool, + Field(description="Hit indicates whether this node was created from a cache entry"), + ] + key: Annotated[str, Field(description="Key is the name of the key used for this node's cache")] class MetricLabel(BaseModel): @@ -245,93 +319,85 @@ class MetricLabel(BaseModel): class Mutex(BaseModel): - name: Optional[str] = Field(default=None, description="name of the mutex") + name: Annotated[Optional[str], Field(description="name of the mutex")] = None class MutexHolding(BaseModel): - holder: Optional[str] = Field( - default=None, - description=( - "Holder is a reference to the object which holds the Mutex. Holding" - " Scenario:\n 1. Current workflow's NodeID which is holding the lock.\n " - " e.g: ${NodeID}\nWaiting Scenario:\n 1. Current workflow or other" - " workflow NodeID which is holding the lock.\n e.g:" - " ${WorkflowName}/${NodeID}" - ), - ) - mutex: Optional[str] = Field( - default=None, - description="Reference for the mutex e.g: ${namespace}/mutex/${mutexName}", - ) + holder: Annotated[ + Optional[str], + Field( + description=( + "Holder is a reference to the object which holds the Mutex. Holding" + " Scenario:\n 1. Current workflow's NodeID which is holding the" + " lock.\n e.g: ${NodeID}\nWaiting Scenario:\n 1. Current workflow" + " or other workflow NodeID which is holding the lock.\n e.g:" + " ${WorkflowName}/${NodeID}" + ) + ), + ] = None + mutex: Annotated[ + Optional[str], + Field(description="Reference for the mutex e.g: ${namespace}/mutex/${mutexName}"), + ] = None class MutexStatus(BaseModel): - holding: Optional[List[MutexHolding]] = Field( - default=None, - description=( - "Holding is a list of mutexes and their respective objects that are held by" - " mutex lock for this io.argoproj.workflow.v1alpha1." + holding: Annotated[ + Optional[List[MutexHolding]], + Field( + description=( + "Holding is a list of mutexes and their respective objects that are" + " held by mutex lock for this io.argoproj.workflow.v1alpha1." + ) ), - ) - waiting: Optional[List[MutexHolding]] = Field( - default=None, - description=("Waiting is a list of mutexes and their respective objects this workflow is" " waiting for."), - ) + ] = None + waiting: Annotated[ + Optional[List[MutexHolding]], + Field( + description=("Waiting is a list of mutexes and their respective objects this" " workflow is waiting for.") + ), + ] = None class NodeSynchronizationStatus(BaseModel): - waiting: Optional[str] = Field( - default=None, - description="Waiting is the name of the lock that this node is waiting for", - ) - - -class NoneStrategy(BaseModel): - pass + waiting: Annotated[ + Optional[str], + Field(description="Waiting is the name of the lock that this node is waiting for"), + ] = None class OAuth2EndpointParam(BaseModel): - key: str = Field(..., description="Name is the header name") - value: Optional[str] = Field(default=None, description="Value is the literal value to use for the header") + key: Annotated[str, Field(description="Name is the header name")] + value: Annotated[ + Optional[str], + Field(description="Value is the literal value to use for the header"), + ] = None class OSSLifecycleRule(BaseModel): - mark_deletion_after_days: Optional[int] = Field( - default=None, - alias="markDeletionAfterDays", - description=("MarkDeletionAfterDays is the number of days before we delete objects in" " the bucket"), - ) - mark_infrequent_access_after_days: Optional[int] = Field( - default=None, - alias="markInfrequentAccessAfterDays", - description=( - "MarkInfrequentAccessAfterDays is the number of days before we convert the" - " objects in the bucket to Infrequent Access (IA) storage type" + mark_deletion_after_days: Annotated[ + Optional[int], + Field( + alias="markDeletionAfterDays", + description=("MarkDeletionAfterDays is the number of days before we delete objects" " in the bucket"), + ), + ] = None + mark_infrequent_access_after_days: Annotated[ + Optional[int], + Field( + alias="markInfrequentAccessAfterDays", + description=( + "MarkInfrequentAccessAfterDays is the number of days before we convert" + " the objects in the bucket to Infrequent Access (IA) storage type" + ), ), - ) + ] = None class Plugin(BaseModel): pass -class Prometheus(BaseModel): - counter: Optional[Counter] = Field(default=None, description="Counter is a counter metric") - gauge: Optional[Gauge] = Field(default=None, description="Gauge is a gauge metric") - help: str = Field(..., description="Help is a string that describes the metric") - histogram: Optional[Histogram] = Field(default=None, description="Histogram is a histogram metric") - labels: Optional[List[MetricLabel]] = Field(default=None, description="Labels is a list of metric labels") - name: str = Field(..., description="Name is the name of the metric") - when: Optional[str] = Field( - default=None, - description=("When is a conditional statement that decides when to emit the metric"), - ) - - -class RawArtifact(BaseModel): - data: str = Field(..., description="Data is the string contents of the artifact") - - class ResubmitArchivedWorkflowRequest(BaseModel): memoized: Optional[bool] = None name: Optional[str] = None @@ -340,36 +406,54 @@ class ResubmitArchivedWorkflowRequest(BaseModel): uid: Optional[str] = None +class RetryNodeAntiAffinity(BaseModel): + pass + + class RetryArchivedWorkflowRequest(BaseModel): name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None parameters: Optional[List[str]] = None - restart_successful: Optional[bool] = Field(default=None, alias="restartSuccessful") + restart_successful: Annotated[Optional[bool], Field(alias="restartSuccessful")] = None uid: Optional[str] = None -class RetryNodeAntiAffinity(BaseModel): - pass - - class SemaphoreHolding(BaseModel): - holders: Optional[List[str]] = Field( - default=None, - description=("Holders stores the list of current holder names in the" " io.argoproj.workflow.v1alpha1."), - ) - semaphore: Optional[str] = Field(default=None, description="Semaphore stores the semaphore name.") + holders: Annotated[ + Optional[List[str]], + Field( + description=("Holders stores the list of current holder names in the" " io.argoproj.workflow.v1alpha1.") + ), + ] = None + semaphore: Annotated[Optional[str], Field(description="Semaphore stores the semaphore name.")] = None class SemaphoreStatus(BaseModel): - holding: Optional[List[SemaphoreHolding]] = Field( - default=None, - description=("Holding stores the list of resource acquired synchronization lock for" " workflows."), - ) - waiting: Optional[List[SemaphoreHolding]] = Field( - default=None, - description=("Waiting indicates the list of current synchronization lock holders."), - ) + holding: Annotated[ + Optional[List[SemaphoreHolding]], + Field(description=("Holding stores the list of resource acquired synchronization lock for" " workflows.")), + ] = None + waiting: Annotated[ + Optional[List[SemaphoreHolding]], + Field(description=("Waiting indicates the list of current synchronization lock holders.")), + ] = None + + +class WorkflowTemplateRef(BaseModel): + cluster_scope: Annotated[ + Optional[bool], + Field( + alias="clusterScope", + description=( + "ClusterScope indicates the referred template is cluster scoped (i.e. a" " ClusterWorkflowTemplate)." + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field(description="Name is the resource name of the workflow template."), + ] = None class SuppliedValueFrom(BaseModel): @@ -377,88 +461,62 @@ class SuppliedValueFrom(BaseModel): class SuspendTemplate(BaseModel): - duration: Optional[str] = Field( - default=None, - description=( - "Duration is the seconds to wait before automatically resuming a template." - " Must be a string. Default unit is seconds. Could also be a Duration," - ' e.g.: "2m", "6h", "1d"' + duration: Annotated[ + Optional[str], + Field( + description=( + "Duration is the seconds to wait before automatically resuming a" + " template. Must be a string. Default unit is seconds. Could also be a" + ' Duration, e.g.: "2m", "6h", "1d"' + ) ), - ) - - -class SynchronizationStatus(BaseModel): - mutex: Optional[MutexStatus] = Field(default=None, description="Mutex stores this workflow's mutex holder details") - semaphore: Optional[SemaphoreStatus] = Field( - default=None, - description="Semaphore stores this workflow's Semaphore holder details", - ) + ] = None class TTLStrategy(BaseModel): - seconds_after_completion: Optional[int] = Field( - default=None, - alias="secondsAfterCompletion", - description=("SecondsAfterCompletion is the number of seconds to live after completion"), - ) - seconds_after_failure: Optional[int] = Field( - default=None, - alias="secondsAfterFailure", - description=("SecondsAfterFailure is the number of seconds to live after failure"), - ) - seconds_after_success: Optional[int] = Field( - default=None, - alias="secondsAfterSuccess", - description=("SecondsAfterSuccess is the number of seconds to live after success"), - ) - - -class TarStrategy(BaseModel): - compression_level: Optional[int] = Field( - default=None, - alias="compressionLevel", - description=( - "CompressionLevel specifies the gzip compression level to use for the" - " artifact. Defaults to gzip.DefaultCompression." + seconds_after_completion: Annotated[ + Optional[int], + Field( + alias="secondsAfterCompletion", + description=("SecondsAfterCompletion is the number of seconds to live after" " completion"), ), - ) - - -class TemplateRef(BaseModel): - cluster_scope: Optional[bool] = Field( - default=None, - alias="clusterScope", - description=( - "ClusterScope indicates the referred template is cluster scoped (i.e. a" " ClusterWorkflowTemplate)." + ] = None + seconds_after_failure: Annotated[ + Optional[int], + Field( + alias="secondsAfterFailure", + description=("SecondsAfterFailure is the number of seconds to live after failure"), + ), + ] = None + seconds_after_success: Annotated[ + Optional[int], + Field( + alias="secondsAfterSuccess", + description=("SecondsAfterSuccess is the number of seconds to live after success"), ), - ) - name: Optional[str] = Field(default=None, description="Name is the resource name of the template.") - template: Optional[str] = Field( - default=None, - description="Template is the name of referred template in the resource.", - ) + ] = None class TransformationStep(BaseModel): - expression: str = Field(..., description="Expression defines an expr expression to apply") + expression: Annotated[str, Field(description="Expression defines an expr expression to apply")] class Version(BaseModel): - build_date: str = Field(..., alias="buildDate") + build_date: Annotated[str, Field(alias="buildDate")] compiler: str - git_commit: str = Field(..., alias="gitCommit") - git_tag: str = Field(..., alias="gitTag") - git_tree_state: str = Field(..., alias="gitTreeState") - go_version: str = Field(..., alias="goVersion") + git_commit: Annotated[str, Field(alias="gitCommit")] + git_tag: Annotated[str, Field(alias="gitTag")] + git_tree_state: Annotated[str, Field(alias="gitTreeState")] + go_version: Annotated[str, Field(alias="goVersion")] platform: str version: str class VolumeClaimGC(BaseModel): - strategy: Optional[str] = Field( - default=None, - description=('Strategy is the strategy to use. One of "OnWorkflowCompletion",' ' "OnWorkflowSuccess"'), - ) + strategy: Annotated[ + Optional[str], + Field(description=('Strategy is the strategy to use. One of "OnWorkflowCompletion",' ' "OnWorkflowSuccess"')), + ] = None class WorkflowDeleteResponse(BaseModel): @@ -468,7 +526,7 @@ class WorkflowDeleteResponse(BaseModel): class WorkflowMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None labels: Optional[Dict[str, str]] = None - labels_from: Optional[Dict[str, LabelValueFrom]] = Field(default=None, alias="labelsFrom") + labels_from: Annotated[Optional[Dict[str, LabelValueFrom]], Field(alias="labelsFrom")] = None class WorkflowResubmitRequest(BaseModel): @@ -481,23 +539,23 @@ class WorkflowResubmitRequest(BaseModel): class WorkflowResumeRequest(BaseModel): name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None class WorkflowRetryRequest(BaseModel): name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None parameters: Optional[List[str]] = None - restart_successful: Optional[bool] = Field(default=None, alias="restartSuccessful") + restart_successful: Annotated[Optional[bool], Field(alias="restartSuccessful")] = None class WorkflowSetRequest(BaseModel): message: Optional[str] = None name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") - output_parameters: Optional[str] = Field(default=None, alias="outputParameters") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None + output_parameters: Annotated[Optional[str], Field(alias="outputParameters")] = None phase: Optional[str] = None @@ -505,7 +563,7 @@ class WorkflowStopRequest(BaseModel): message: Optional[str] = None name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None class WorkflowSuspendRequest(BaseModel): @@ -517,2000 +575,1735 @@ class WorkflowTemplateDeleteResponse(BaseModel): pass -class WorkflowTemplateRef(BaseModel): - cluster_scope: Optional[bool] = Field( - default=None, - alias="clusterScope", - description=( - "ClusterScope indicates the referred template is cluster scoped (i.e. a" " ClusterWorkflowTemplate)." - ), - ) - name: Optional[str] = Field(default=None, description="Name is the resource name of the workflow template.") - - class WorkflowTerminateRequest(BaseModel): name: Optional[str] = None namespace: Optional[str] = None -class ZipStrategy(BaseModel): - pass - - -class ArchiveStrategy(BaseModel): - none: Optional[NoneStrategy] = None - tar: Optional[TarStrategy] = None - zip: Optional[ZipStrategy] = None +class CronWorkflowStatus(BaseModel): + active: Annotated[ + Optional[List[v1.ObjectReference]], + Field(description=("Active is a list of active workflows stemming from this CronWorkflow")), + ] = None + conditions: Annotated[ + Optional[List[Condition]], + Field(description="Conditions is a list of conditions the CronWorkflow may have"), + ] = None + last_scheduled_time: Annotated[ + Optional[v1_1.Time], + Field( + alias="lastScheduledTime", + description=("LastScheduleTime is the last time the CronWorkflow was scheduled"), + ), + ] = None -class ArtifactGC(BaseModel): - pod_metadata: Optional[Metadata] = Field( - default=None, - alias="podMetadata", - description=( - "PodMetadata is an optional field for specifying the Labels and Annotations" - " that should be assigned to the Pod doing the deletion" +class ArtifactoryArtifact(BaseModel): + password_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="passwordSecret", + description=("PasswordSecret is the secret selector to the repository password"), ), - ) - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - description=( - "ServiceAccountName is an optional field for specifying the Service Account" - " that should be assigned to the Pod doing the deletion" + ] = None + url: Annotated[str, Field(description="URL of the artifact")] + username_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="usernameSecret", + description=("UsernameSecret is the secret selector to the repository username"), ), - ) - strategy: Optional[str] = Field(default=None, description="Strategy is the strategy to use.") - - -class ArtifactGCStatus(BaseModel): - artifact_results_by_node: Optional[Dict[str, ArtifactResultNodeStatus]] = Field( - default=None, - alias="artifactResultsByNode", - description="ArtifactResultsByNode maps Node name to result", - ) - - -class ArtifactoryArtifact(BaseModel): - password_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="passwordSecret", - description="PasswordSecret is the secret selector to the repository password", - ) - url: str = Field(..., description="URL of the artifact") - username_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="usernameSecret", - description="UsernameSecret is the secret selector to the repository username", - ) + ] = None class ArtifactoryArtifactRepository(BaseModel): - password_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="passwordSecret", - description="PasswordSecret is the secret selector to the repository password", - ) - repo_url: Optional[str] = Field( - default=None, - alias="repoURL", - description="RepoURL is the url for artifactory repo.", - ) - username_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="usernameSecret", - description="UsernameSecret is the secret selector to the repository username", - ) + password_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="passwordSecret", + description=("PasswordSecret is the secret selector to the repository password"), + ), + ] = None + repo_url: Annotated[ + Optional[str], + Field(alias="repoURL", description="RepoURL is the url for artifactory repo."), + ] = None + username_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="usernameSecret", + description=("UsernameSecret is the secret selector to the repository username"), + ), + ] = None class AzureArtifact(BaseModel): - account_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accountKeySecret", - description=("AccountKeySecret is the secret selector to the Azure Blob Storage account" " access key"), - ) - blob: str = Field( - ..., - description=("Blob is the blob name (i.e., path) in the container where the artifact" " resides"), - ) - container: str = Field(..., description="Container is the container where resources will be stored") - endpoint: str = Field( - ..., - description=( - "Endpoint is the service url associated with an account. It is most likely" - ' "https://.blob.core.windows.net"' - ), - ) - use_sdk_creds: Optional[bool] = Field( - default=None, - alias="useSDKCreds", - description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), - ) + account_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accountKeySecret", + description=("AccountKeySecret is the secret selector to the Azure Blob Storage" " account access key"), + ), + ] = None + blob: Annotated[ + str, + Field(description=("Blob is the blob name (i.e., path) in the container where the artifact" " resides")), + ] + container: Annotated[ + str, + Field(description="Container is the container where resources will be stored"), + ] + endpoint: Annotated[ + str, + Field( + description=( + "Endpoint is the service url associated with an account. It is most" + ' likely "https://.blob.core.windows.net"' + ) + ), + ] + use_sdk_creds: Annotated[ + Optional[bool], + Field( + alias="useSDKCreds", + description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), + ), + ] = None class AzureArtifactRepository(BaseModel): - account_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accountKeySecret", - description=("AccountKeySecret is the secret selector to the Azure Blob Storage account" " access key"), - ) - blob_name_format: Optional[str] = Field( - default=None, - alias="blobNameFormat", - description=( - "BlobNameFormat is defines the format of how to store blob names. Can" " reference workflow variables" - ), - ) - container: str = Field(..., description="Container is the container where resources will be stored") - endpoint: str = Field( - ..., - description=( - "Endpoint is the service url associated with an account. It is most likely" - ' "https://.blob.core.windows.net"' - ), - ) - use_sdk_creds: Optional[bool] = Field( - default=None, - alias="useSDKCreds", - description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), - ) - - -class Backoff(BaseModel): - duration: Optional[str] = Field( - default=None, - description=( - "Duration is the amount to back off. Default unit is seconds, but could" - ' also be a duration (e.g. "2m", "1h")' - ), - ) - factor: Optional[intstr.IntOrString] = Field( - default=None, - description=("Factor is a factor to multiply the base duration after each failed retry"), - ) - max_duration: Optional[str] = Field( - default=None, - alias="maxDuration", - description=("MaxDuration is the maximum amount of time allowed for the backoff strategy"), - ) + account_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accountKeySecret", + description=("AccountKeySecret is the secret selector to the Azure Blob Storage" " account access key"), + ), + ] = None + blob_name_format: Annotated[ + Optional[str], + Field( + alias="blobNameFormat", + description=( + "BlobNameFormat is defines the format of how to store blob names. Can" " reference workflow variables" + ), + ), + ] = None + container: Annotated[ + str, + Field(description="Container is the container where resources will be stored"), + ] + endpoint: Annotated[ + str, + Field( + description=( + "Endpoint is the service url associated with an account. It is most" + ' likely "https://.blob.core.windows.net"' + ) + ), + ] + use_sdk_creds: Annotated[ + Optional[bool], + Field( + alias="useSDKCreds", + description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), + ), + ] = None class BasicAuth(BaseModel): - password_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="passwordSecret", - description="PasswordSecret is the secret selector to the repository password", - ) - username_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="usernameSecret", - description="UsernameSecret is the secret selector to the repository username", - ) - - -class Cache(BaseModel): - config_map: v1.ConfigMapKeySelector = Field( - ..., alias="configMap", description="ConfigMap sets a ConfigMap-based cache" - ) + password_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="passwordSecret", + description=("PasswordSecret is the secret selector to the repository password"), + ), + ] = None + username_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="usernameSecret", + description=("UsernameSecret is the secret selector to the repository username"), + ), + ] = None class ClientCertAuth(BaseModel): - client_cert_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="clientCertSecret") - client_key_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="clientKeySecret") + client_cert_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="clientCertSecret")] = None + client_key_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="clientKeySecret")] = None -class ContainerSetRetryStrategy(BaseModel): - duration: Optional[str] = Field( - default=None, - description=( - 'Duration is the time between each retry, examples values are "300ms", "1s"' - ' or "5m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".' +class GCSArtifact(BaseModel): + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + key: Annotated[ + str, + Field(description="Key is the path in the bucket where the artifact resides"), + ] + service_account_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="serviceAccountKeySecret", + description=("ServiceAccountKeySecret is the secret selector to the bucket's service" " account key"), ), - ) - retries: intstr.IntOrString = Field(..., description="Nbr of retries") + ] = None -class CronWorkflowStatus(BaseModel): - active: Optional[List[v1.ObjectReference]] = Field( - default=None, - description=("Active is a list of active workflows stemming from this CronWorkflow"), - ) - conditions: Optional[List[Condition]] = Field( - default=None, - description="Conditions is a list of conditions the CronWorkflow may have", - ) - last_scheduled_time: Optional[v1_1.Time] = Field( - default=None, - alias="lastScheduledTime", - description="LastScheduleTime is the last time the CronWorkflow was scheduled", - ) +class GCSArtifactRepository(BaseModel): + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + key_format: Annotated[ + Optional[str], + Field( + alias="keyFormat", + description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), + ), + ] = None + service_account_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="serviceAccountKeySecret", + description=("ServiceAccountKeySecret is the secret selector to the bucket's service" " account key"), + ), + ] = None -class GCSArtifact(BaseModel): - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - key: str = Field(..., description="Key is the path in the bucket where the artifact resides") - service_account_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serviceAccountKeySecret", - description=("ServiceAccountKeySecret is the secret selector to the bucket's service" " account key"), - ) +class GitArtifact(BaseModel): + branch: Annotated[ + Optional[str], + Field(description="Branch is the branch to fetch when `SingleBranch` is enabled"), + ] = None + depth: Annotated[ + Optional[int], + Field( + description=( + "Depth specifies clones/fetches should be shallow and include the given" + " number of commits from the branch tip" + ) + ), + ] = None + disable_submodules: Annotated[ + Optional[bool], + Field( + alias="disableSubmodules", + description="DisableSubmodules disables submodules during git clone", + ), + ] = None + fetch: Annotated[ + Optional[List[str]], + Field(description=("Fetch specifies a number of refs that should be fetched before" " checkout")), + ] = None + insecure_ignore_host_key: Annotated[ + Optional[bool], + Field( + alias="insecureIgnoreHostKey", + description=("InsecureIgnoreHostKey disables SSH strict host key checking during git" " clone"), + ), + ] = None + password_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="passwordSecret", + description=("PasswordSecret is the secret selector to the repository password"), + ), + ] = None + repo: Annotated[str, Field(description="Repo is the git repository")] + revision: Annotated[ + Optional[str], + Field(description="Revision is the git commit, tag, branch to checkout"), + ] = None + single_branch: Annotated[ + Optional[bool], + Field( + alias="singleBranch", + description=("SingleBranch enables single branch clone, using the `branch` parameter"), + ), + ] = None + ssh_private_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="sshPrivateKeySecret", + description=("SSHPrivateKeySecret is the secret selector to the repository ssh" " private key"), + ), + ] = None + username_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="usernameSecret", + description=("UsernameSecret is the secret selector to the repository username"), + ), + ] = None -class GCSArtifactRepository(BaseModel): - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - key_format: Optional[str] = Field( - default=None, - alias="keyFormat", - description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), - ) - service_account_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serviceAccountKeySecret", - description=("ServiceAccountKeySecret is the secret selector to the bucket's service" " account key"), - ) +class HTTPHeaderSource(BaseModel): + secret_key_ref: Annotated[Optional[v1.SecretKeySelector], Field(alias="secretKeyRef")] = None -class GitArtifact(BaseModel): - branch: Optional[str] = Field( - default=None, - description="Branch is the branch to fetch when `SingleBranch` is enabled", - ) - depth: Optional[int] = Field( - default=None, - description=( - "Depth specifies clones/fetches should be shallow and include the given" - " number of commits from the branch tip" - ), - ) - disable_submodules: Optional[bool] = Field( - default=None, - alias="disableSubmodules", - description="DisableSubmodules disables submodules during git clone", - ) - fetch: Optional[List[str]] = Field( - default=None, - description=("Fetch specifies a number of refs that should be fetched before checkout"), - ) - insecure_ignore_host_key: Optional[bool] = Field( - default=None, - alias="insecureIgnoreHostKey", - description=("InsecureIgnoreHostKey disables SSH strict host key checking during git" " clone"), - ) - password_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="passwordSecret", - description="PasswordSecret is the secret selector to the repository password", - ) - repo: str = Field(..., description="Repo is the git repository") - revision: Optional[str] = Field(default=None, description="Revision is the git commit, tag, branch to checkout") - single_branch: Optional[bool] = Field( - default=None, - alias="singleBranch", - description=("SingleBranch enables single branch clone, using the `branch` parameter"), - ) - ssh_private_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sshPrivateKeySecret", - description=("SSHPrivateKeySecret is the secret selector to the repository ssh" " private key"), - ) - username_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="usernameSecret", - description="UsernameSecret is the secret selector to the repository username", - ) +class OAuth2Auth(BaseModel): + client_id_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="clientIDSecret")] = None + client_secret_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="clientSecretSecret")] = None + endpoint_params: Annotated[Optional[List[OAuth2EndpointParam]], Field(alias="endpointParams")] = None + scopes: Optional[List[str]] = None + token_url_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="tokenURLSecret")] = None -class HDFSArtifact(BaseModel): - addresses: Optional[List[str]] = Field( - default=None, description="Addresses is accessible addresses of HDFS name nodes" - ) - force: Optional[bool] = Field(default=None, description="Force copies a file forcibly even if it exists") - hdfs_user: Optional[str] = Field( - default=None, - alias="hdfsUser", - description=( - "HDFSUser is the user to access HDFS file system. It is ignored if either" " ccache or keytab is used." - ), - ) - krb_c_cache_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbCCacheSecret", - description=( - "KrbCCacheSecret is the secret selector for Kerberos ccache Either ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_config_config_map: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="krbConfigConfigMap", - description=( - "KrbConfig is the configmap selector for Kerberos config as string It must" - " be set if either ccache or keytab is used." - ), - ) - krb_keytab_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbKeytabSecret", - description=( - "KrbKeytabSecret is the secret selector for Kerberos keytab Either ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_realm: Optional[str] = Field( - default=None, - alias="krbRealm", - description=("KrbRealm is the Kerberos realm used with Kerberos keytab It must be set if" " keytab is used."), - ) - krb_service_principal_name: Optional[str] = Field( - default=None, - alias="krbServicePrincipalName", - description=( - "KrbServicePrincipalName is the principal name of Kerberos service It must" - " be set if either ccache or keytab is used." - ), - ) - krb_username: Optional[str] = Field( - default=None, - alias="krbUsername", - description=( - "KrbUsername is the Kerberos username used with Kerberos keytab It must be" " set if keytab is used." - ), - ) - path: str = Field(..., description="Path is a file path in HDFS") +class S3EncryptionOptions(BaseModel): + enable_encryption: Annotated[ + Optional[bool], + Field( + alias="enableEncryption", + description=( + "EnableEncryption tells the driver to encrypt objects if set to true." + " If kmsKeyId and serverSideCustomerKeySecret are not set, SSE-S3 will" + " be used" + ), + ), + ] = None + kms_encryption_context: Annotated[ + Optional[str], + Field( + alias="kmsEncryptionContext", + description=( + "KmsEncryptionContext is a json blob that contains an encryption" + " context. See" + " https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context" + " for more information" + ), + ), + ] = None + kms_key_id: Annotated[ + Optional[str], + Field( + alias="kmsKeyId", + description=("KMSKeyId tells the driver to encrypt the object using the specified" " KMS Key."), + ), + ] = None + server_side_customer_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="serverSideCustomerKeySecret", + description=( + "ServerSideCustomerKeySecret tells the driver to encrypt the output" + " artifacts using SSE-C with the specified secret." + ), + ), + ] = None -class HDFSArtifactRepository(BaseModel): - addresses: Optional[List[str]] = Field( - default=None, description="Addresses is accessible addresses of HDFS name nodes" - ) - force: Optional[bool] = Field(default=None, description="Force copies a file forcibly even if it exists") - hdfs_user: Optional[str] = Field( - default=None, - alias="hdfsUser", - description=( - "HDFSUser is the user to access HDFS file system. It is ignored if either" " ccache or keytab is used." - ), - ) - krb_c_cache_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbCCacheSecret", - description=( - "KrbCCacheSecret is the secret selector for Kerberos ccache Either ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_config_config_map: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="krbConfigConfigMap", - description=( - "KrbConfig is the configmap selector for Kerberos config as string It must" - " be set if either ccache or keytab is used." - ), - ) - krb_keytab_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbKeytabSecret", - description=( - "KrbKeytabSecret is the secret selector for Kerberos keytab Either ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_realm: Optional[str] = Field( - default=None, - alias="krbRealm", - description=("KrbRealm is the Kerberos realm used with Kerberos keytab It must be set if" " keytab is used."), - ) - krb_service_principal_name: Optional[str] = Field( - default=None, - alias="krbServicePrincipalName", - description=( - "KrbServicePrincipalName is the principal name of Kerberos service It must" - " be set if either ccache or keytab is used." - ), - ) - krb_username: Optional[str] = Field( - default=None, - alias="krbUsername", - description=( - "KrbUsername is the Kerberos username used with Kerberos keytab It must be" " set if keytab is used." - ), - ) - path_format: Optional[str] = Field( - default=None, - alias="pathFormat", - description=("PathFormat is defines the format of path to store a file. Can reference" " workflow variables"), - ) +class Cache(BaseModel): + config_map: Annotated[ + v1.ConfigMapKeySelector, + Field(alias="configMap", description="ConfigMap sets a ConfigMap-based cache"), + ] -class HTTPHeaderSource(BaseModel): - secret_key_ref: Optional[v1.SecretKeySelector] = Field(default=None, alias="secretKeyRef") +class HDFSArtifact(BaseModel): + addresses: Annotated[ + Optional[List[str]], + Field(description="Addresses is accessible addresses of HDFS name nodes"), + ] = None + force: Annotated[ + Optional[bool], + Field(description="Force copies a file forcibly even if it exists"), + ] = None + hdfs_user: Annotated[ + Optional[str], + Field( + alias="hdfsUser", + description=( + "HDFSUser is the user to access HDFS file system. It is ignored if" " either ccache or keytab is used." + ), + ), + ] = None + krb_c_cache_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="krbCCacheSecret", + description=( + "KrbCCacheSecret is the secret selector for Kerberos ccache Either" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_config_config_map: Annotated[ + Optional[v1.ConfigMapKeySelector], + Field( + alias="krbConfigConfigMap", + description=( + "KrbConfig is the configmap selector for Kerberos config as string It" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_keytab_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="krbKeytabSecret", + description=( + "KrbKeytabSecret is the secret selector for Kerberos keytab Either" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_realm: Annotated[ + Optional[str], + Field( + alias="krbRealm", + description=( + "KrbRealm is the Kerberos realm used with Kerberos keytab It must be" " set if keytab is used." + ), + ), + ] = None + krb_service_principal_name: Annotated[ + Optional[str], + Field( + alias="krbServicePrincipalName", + description=( + "KrbServicePrincipalName is the principal name of Kerberos service It" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_username: Annotated[ + Optional[str], + Field( + alias="krbUsername", + description=( + "KrbUsername is the Kerberos username used with Kerberos keytab It must" " be set if keytab is used." + ), + ), + ] = None + path: Annotated[str, Field(description="Path is a file path in HDFS")] -class InfoResponse(BaseModel): - links: Optional[List[Link]] = None - managed_namespace: Optional[str] = Field(default=None, alias="managedNamespace") - modals: Optional[Dict[str, bool]] = Field(default=None, title="which modals to show") - nav_color: Optional[str] = Field(default=None, alias="navColor") +class HDFSArtifactRepository(BaseModel): + addresses: Annotated[ + Optional[List[str]], + Field(description="Addresses is accessible addresses of HDFS name nodes"), + ] = None + force: Annotated[ + Optional[bool], + Field(description="Force copies a file forcibly even if it exists"), + ] = None + hdfs_user: Annotated[ + Optional[str], + Field( + alias="hdfsUser", + description=( + "HDFSUser is the user to access HDFS file system. It is ignored if" " either ccache or keytab is used." + ), + ), + ] = None + krb_c_cache_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="krbCCacheSecret", + description=( + "KrbCCacheSecret is the secret selector for Kerberos ccache Either" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_config_config_map: Annotated[ + Optional[v1.ConfigMapKeySelector], + Field( + alias="krbConfigConfigMap", + description=( + "KrbConfig is the configmap selector for Kerberos config as string It" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_keytab_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="krbKeytabSecret", + description=( + "KrbKeytabSecret is the secret selector for Kerberos keytab Either" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_realm: Annotated[ + Optional[str], + Field( + alias="krbRealm", + description=( + "KrbRealm is the Kerberos realm used with Kerberos keytab It must be" " set if keytab is used." + ), + ), + ] = None + krb_service_principal_name: Annotated[ + Optional[str], + Field( + alias="krbServicePrincipalName", + description=( + "KrbServicePrincipalName is the principal name of Kerberos service It" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_username: Annotated[ + Optional[str], + Field( + alias="krbUsername", + description=( + "KrbUsername is the Kerberos username used with Kerberos keytab It must" " be set if keytab is used." + ), + ), + ] = None + path_format: Annotated[ + Optional[str], + Field( + alias="pathFormat", + description=( + "PathFormat is defines the format of path to store a file. Can" " reference workflow variables" + ), + ), + ] = None -class Memoize(BaseModel): - cache: Cache = Field(..., description="Cache sets and configures the kind of cache") - key: str = Field(..., description="Key is the key to use as the caching key") - max_age: str = Field( - ..., - alias="maxAge", - description=( - 'MaxAge is the maximum age (e.g. "180s", "24h") of an entry that is still' - " considered valid. If an entry is older than the MaxAge, it will be" - " ignored." +class SemaphoreRef(BaseModel): + config_map_key_ref: Annotated[ + Optional[v1.ConfigMapKeySelector], + Field( + alias="configMapKeyRef", + description=("ConfigMapKeyRef is configmap selector for Semaphore configuration"), ), - ) + ] = None -class Metrics(BaseModel): - prometheus: Optional[List[Prometheus]] = Field( - default=None, - description="Prometheus is a list of prometheus metrics to be emitted", - ) +class ArchiveStrategy(BaseModel): + none: Optional[NoneStrategy] = None + tar: Optional[TarStrategy] = None + zip: Optional[ZipStrategy] = None -class OAuth2Auth(BaseModel): - client_id_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="clientIDSecret") - client_secret_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="clientSecretSecret") - endpoint_params: Optional[List[OAuth2EndpointParam]] = Field(default=None, alias="endpointParams") - scopes: Optional[List[str]] = None - token_url_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="tokenURLSecret") +class ArtifactGC(BaseModel): + pod_metadata: Annotated[ + Optional[Metadata], + Field( + alias="podMetadata", + description=( + "PodMetadata is an optional field for specifying the Labels and" + " Annotations that should be assigned to the Pod doing the deletion" + ), + ), + ] = None + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + description=( + "ServiceAccountName is an optional field for specifying the Service" + " Account that should be assigned to the Pod doing the deletion" + ), + ), + ] = None + strategy: Annotated[Optional[str], Field(description="Strategy is the strategy to use.")] = None -class OSSArtifact(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKeySecret", - description="AccessKeySecret is the secret selector to the bucket's access key", - ) - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - create_bucket_if_not_present: Optional[bool] = Field( - default=None, - alias="createBucketIfNotPresent", - description=( - "CreateBucketIfNotPresent tells the driver to attempt to create the OSS" - " bucket for output artifacts, if it doesn't exist" - ), - ) - endpoint: Optional[str] = Field(default=None, description="Endpoint is the hostname of the bucket endpoint") - key: str = Field(..., description="Key is the path in the bucket where the artifact resides") - lifecycle_rule: Optional[OSSLifecycleRule] = Field( - default=None, - alias="lifecycleRule", - description="LifecycleRule specifies how to manage bucket's lifecycle", - ) - secret_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKeySecret", - description="SecretKeySecret is the secret selector to the bucket's secret key", - ) - security_token: Optional[str] = Field( - default=None, - alias="securityToken", - description=( - "SecurityToken is the user's temporary security token. For more details," - " check out: https://www.alibabacloud.com/help/doc-detail/100624.htm" - ), - ) +class Backoff(BaseModel): + duration: Annotated[ + Optional[str], + Field( + description=( + "Duration is the amount to back off. Default unit is seconds, but could" + ' also be a duration (e.g. "2m", "1h")' + ) + ), + ] = None + factor: Annotated[ + Optional[intstr.IntOrString], + Field(description=("Factor is a factor to multiply the base duration after each failed" " retry")), + ] = None + max_duration: Annotated[ + Optional[str], + Field( + alias="maxDuration", + description=("MaxDuration is the maximum amount of time allowed for the backoff" " strategy"), + ), + ] = None -class OSSArtifactRepository(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKeySecret", - description="AccessKeySecret is the secret selector to the bucket's access key", - ) - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - create_bucket_if_not_present: Optional[bool] = Field( - default=None, - alias="createBucketIfNotPresent", - description=( - "CreateBucketIfNotPresent tells the driver to attempt to create the OSS" - " bucket for output artifacts, if it doesn't exist" - ), - ) - endpoint: Optional[str] = Field(default=None, description="Endpoint is the hostname of the bucket endpoint") - key_format: Optional[str] = Field( - default=None, - alias="keyFormat", - description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), - ) - lifecycle_rule: Optional[OSSLifecycleRule] = Field( - default=None, - alias="lifecycleRule", - description="LifecycleRule specifies how to manage bucket's lifecycle", - ) - secret_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKeySecret", - description="SecretKeySecret is the secret selector to the bucket's secret key", - ) - security_token: Optional[str] = Field( - default=None, - alias="securityToken", - description=( - "SecurityToken is the user's temporary security token. For more details," - " check out: https://www.alibabacloud.com/help/doc-detail/100624.htm" - ), - ) +class ContainerSetRetryStrategy(BaseModel): + duration: Annotated[ + Optional[str], + Field( + description=( + 'Duration is the time between each retry, examples values are "300ms",' + ' "1s" or "5m". Valid time units are "ns", "us" (or "µs"), "ms", "s",' + ' "m", "h".' + ) + ), + ] = None + retries: Annotated[intstr.IntOrString, Field(description="Nbr of retries")] -class RetryAffinity(BaseModel): - node_anti_affinity: Optional[RetryNodeAntiAffinity] = Field(default=None, alias="nodeAntiAffinity") +class Sequence(BaseModel): + count: Annotated[ + Optional[intstr.IntOrString], + Field(description=("Count is number of elements in the sequence (default: 0). Not to be" " used with end")), + ] = None + end: Annotated[ + Optional[intstr.IntOrString], + Field(description=("Number at which to end the sequence (default: 0). Not to be used with" " Count")), + ] = None + format: Annotated[ + Optional[str], + Field(description=("Format is a printf format string to format the value in the sequence")), + ] = None + start: Annotated[ + Optional[intstr.IntOrString], + Field(description="Number at which to start the sequence (default: 0)"), + ] = None -class RetryStrategy(BaseModel): - affinity: Optional[RetryAffinity] = Field( - default=None, - description="Affinity prevents running workflow's step on the same host", - ) - backoff: Optional[Backoff] = Field(default=None, description="Backoff is a backoff strategy") - expression: Optional[str] = Field( - default=None, - description=( - "Expression is a condition expression for when a node will be retried. If" - " it evaluates to false, the node will not be retried and the retry" - " strategy will be ignored" - ), - ) - limit: Optional[intstr.IntOrString] = Field( - default=None, - description=( - "Limit is the maximum number of retry attempts when retrying a container." - " It does not include the original container; the maximum number of total" - " attempts will be `limit + 1`." - ), - ) - retry_policy: Optional[str] = Field( - default=None, - alias="retryPolicy", - description=("RetryPolicy is a policy of NodePhase statuses that will be retried"), - ) +class Prometheus(BaseModel): + counter: Annotated[Optional[Counter], Field(description="Counter is a counter metric")] = None + gauge: Annotated[Optional[Gauge], Field(description="Gauge is a gauge metric")] = None + help: Annotated[str, Field(description="Help is a string that describes the metric")] + histogram: Annotated[Optional[Histogram], Field(description="Histogram is a histogram metric")] = None + labels: Annotated[ + Optional[List[MetricLabel]], + Field(description="Labels is a list of metric labels"), + ] = None + name: Annotated[str, Field(description="Name is the name of the metric")] + when: Annotated[ + Optional[str], + Field(description=("When is a conditional statement that decides when to emit the metric")), + ] = None -class S3EncryptionOptions(BaseModel): - enable_encryption: Optional[bool] = Field( - default=None, - alias="enableEncryption", - description=( - "EnableEncryption tells the driver to encrypt objects if set to true. If" - " kmsKeyId and serverSideCustomerKeySecret are not set, SSE-S3 will be used" - ), - ) - kms_encryption_context: Optional[str] = Field( - default=None, - alias="kmsEncryptionContext", - description=( - "KmsEncryptionContext is a json blob that contains an encryption context." - " See https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context" - " for more information" - ), - ) - kms_key_id: Optional[str] = Field( - default=None, - alias="kmsKeyId", - description=("KMSKeyId tells the driver to encrypt the object using the specified KMS" " Key."), - ) - server_side_customer_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serverSideCustomerKeySecret", - description=( - "ServerSideCustomerKeySecret tells the driver to encrypt the output" - " artifacts using SSE-C with the specified secret." - ), - ) +class OSSArtifact(BaseModel): + access_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accessKeySecret", + description=("AccessKeySecret is the secret selector to the bucket's access key"), + ), + ] = None + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + create_bucket_if_not_present: Annotated[ + Optional[bool], + Field( + alias="createBucketIfNotPresent", + description=( + "CreateBucketIfNotPresent tells the driver to attempt to create the OSS" + " bucket for output artifacts, if it doesn't exist" + ), + ), + ] = None + endpoint: Annotated[ + Optional[str], + Field(description="Endpoint is the hostname of the bucket endpoint"), + ] = None + key: Annotated[ + str, + Field(description="Key is the path in the bucket where the artifact resides"), + ] + lifecycle_rule: Annotated[ + Optional[OSSLifecycleRule], + Field( + alias="lifecycleRule", + description="LifecycleRule specifies how to manage bucket's lifecycle", + ), + ] = None + secret_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="secretKeySecret", + description=("SecretKeySecret is the secret selector to the bucket's secret key"), + ), + ] = None + security_token: Annotated[ + Optional[str], + Field( + alias="securityToken", + description=( + "SecurityToken is the user's temporary security token. For more" + " details, check out:" + " https://www.alibabacloud.com/help/doc-detail/100624.htm" + ), + ), + ] = None -class SemaphoreRef(BaseModel): - config_map_key_ref: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="configMapKeyRef", - description="ConfigMapKeyRef is configmap selector for Semaphore configuration", - ) +class OSSArtifactRepository(BaseModel): + access_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accessKeySecret", + description=("AccessKeySecret is the secret selector to the bucket's access key"), + ), + ] = None + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + create_bucket_if_not_present: Annotated[ + Optional[bool], + Field( + alias="createBucketIfNotPresent", + description=( + "CreateBucketIfNotPresent tells the driver to attempt to create the OSS" + " bucket for output artifacts, if it doesn't exist" + ), + ), + ] = None + endpoint: Annotated[ + Optional[str], + Field(description="Endpoint is the hostname of the bucket endpoint"), + ] = None + key_format: Annotated[ + Optional[str], + Field( + alias="keyFormat", + description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), + ), + ] = None + lifecycle_rule: Annotated[ + Optional[OSSLifecycleRule], + Field( + alias="lifecycleRule", + description="LifecycleRule specifies how to manage bucket's lifecycle", + ), + ] = None + secret_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="secretKeySecret", + description=("SecretKeySecret is the secret selector to the bucket's secret key"), + ), + ] = None + security_token: Annotated[ + Optional[str], + Field( + alias="securityToken", + description=( + "SecurityToken is the user's temporary security token. For more" + " details, check out:" + " https://www.alibabacloud.com/help/doc-detail/100624.htm" + ), + ), + ] = None -class Sequence(BaseModel): - count: Optional[intstr.IntOrString] = Field( - default=None, - description=("Count is number of elements in the sequence (default: 0). Not to be used" " with end"), - ) - end: Optional[intstr.IntOrString] = Field( - default=None, - description=("Number at which to end the sequence (default: 0). Not to be used with" " Count"), - ) - format: Optional[str] = Field( - default=None, - description=("Format is a printf format string to format the value in the sequence"), - ) - start: Optional[intstr.IntOrString] = Field( - default=None, description="Number at which to start the sequence (default: 0)" - ) +class RetryAffinity(BaseModel): + node_anti_affinity: Annotated[Optional[RetryNodeAntiAffinity], Field(alias="nodeAntiAffinity")] = None -class SubmitOpts(BaseModel): - annotations: Optional[str] = Field(default=None, description="Annotations adds to metadata.labels") - dry_run: Optional[bool] = Field( - default=None, - alias="dryRun", - description=( - "DryRun validates the workflow on the client-side without creating it. This" - " option is not supported in API" - ), - ) - entry_point: Optional[str] = Field( - default=None, - alias="entryPoint", - description="Entrypoint overrides spec.entrypoint", - ) - generate_name: Optional[str] = Field( - default=None, - alias="generateName", - description="GenerateName overrides metadata.generateName", - ) - labels: Optional[str] = Field(default=None, description="Labels adds to metadata.labels") - name: Optional[str] = Field(default=None, description="Name overrides metadata.name") - owner_reference: Optional[v1_1.OwnerReference] = Field( - default=None, - alias="ownerReference", - description="OwnerReference creates a metadata.ownerReference", - ) - parameters: Optional[List[str]] = Field(default=None, description="Parameters passes input parameters to workflow") - pod_priority_class_name: Optional[str] = Field( - default=None, - alias="podPriorityClassName", - description="Set the podPriorityClassName of the workflow", - ) - priority: Optional[int] = Field( - default=None, - description=( - "Priority is used if controller is configured to process limited number of" - " workflows in parallel, higher priority workflows are processed first." - ), - ) - server_dry_run: Optional[bool] = Field( - default=None, - alias="serverDryRun", - description=("ServerDryRun validates the workflow on the server-side without creating it"), - ) - service_account: Optional[str] = Field( - default=None, - alias="serviceAccount", - description=("ServiceAccount runs all pods in the workflow using specified" " ServiceAccount."), - ) +class SynchronizationStatus(BaseModel): + mutex: Annotated[ + Optional[MutexStatus], + Field(description="Mutex stores this workflow's mutex holder details"), + ] = None + semaphore: Annotated[ + Optional[SemaphoreStatus], + Field(description="Semaphore stores this workflow's Semaphore holder details"), + ] = None -class Synchronization(BaseModel): - mutex: Optional[Mutex] = Field(default=None, description="Mutex holds the Mutex lock details") - semaphore: Optional[SemaphoreRef] = Field(default=None, description="Semaphore holds the Semaphore configuration") +class SubmitOpts(BaseModel): + annotations: Annotated[Optional[str], Field(description="Annotations adds to metadata.labels")] = None + dry_run: Annotated[ + Optional[bool], + Field( + alias="dryRun", + description=( + "DryRun validates the workflow on the client-side without creating it." + " This option is not supported in API" + ), + ), + ] = None + entry_point: Annotated[ + Optional[str], + Field(alias="entryPoint", description="Entrypoint overrides spec.entrypoint"), + ] = None + generate_name: Annotated[ + Optional[str], + Field( + alias="generateName", + description="GenerateName overrides metadata.generateName", + ), + ] = None + labels: Annotated[Optional[str], Field(description="Labels adds to metadata.labels")] = None + name: Annotated[Optional[str], Field(description="Name overrides metadata.name")] = None + owner_reference: Annotated[ + Optional[v1_1.OwnerReference], + Field( + alias="ownerReference", + description="OwnerReference creates a metadata.ownerReference", + ), + ] = None + parameters: Annotated[ + Optional[List[str]], + Field(description="Parameters passes input parameters to workflow"), + ] = None + pod_priority_class_name: Annotated[ + Optional[str], + Field( + alias="podPriorityClassName", + description="Set the podPriorityClassName of the workflow", + ), + ] = None + priority: Annotated[ + Optional[int], + Field( + description=( + "Priority is used if controller is configured to process limited number" + " of workflows in parallel, higher priority workflows are processed" + " first." + ) + ), + ] = None + server_dry_run: Annotated[ + Optional[bool], + Field( + alias="serverDryRun", + description=("ServerDryRun validates the workflow on the server-side without" " creating it"), + ), + ] = None + service_account: Annotated[ + Optional[str], + Field( + alias="serviceAccount", + description=("ServiceAccount runs all pods in the workflow using specified" " ServiceAccount."), + ), + ] = None class ValueFrom(BaseModel): - config_map_key_ref: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="configMapKeyRef", - description=("ConfigMapKeyRef is configmap selector for input parameter configuration"), - ) - default: Optional[str] = Field( - default=None, - description=( - "Default specifies a value to be used if retrieving the value from the" " specified source fails" - ), - ) - event: Optional[str] = Field( - default=None, - description=( - "Selector (https://github.com/antonmedv/expr) that is evaluated against the" - " event to get the value of the parameter. E.g. `payload.message`" - ), - ) - expression: Optional[str] = Field( - default=None, - description=("Expression, if defined, is evaluated to specify the value for the" " parameter"), - ) - jq_filter: Optional[str] = Field( - default=None, - alias="jqFilter", - description=("JQFilter expression against the resource object in resource templates"), - ) - json_path: Optional[str] = Field( - default=None, - alias="jsonPath", - description=("JSONPath of a resource to retrieve an output parameter value from in" " resource templates"), - ) - parameter: Optional[str] = Field( - default=None, - description=( - "Parameter reference to a step or dag task in which to retrieve an output" - " parameter value from (e.g. '{{steps.mystep.outputs.myparam}}')" - ), - ) - path: Optional[str] = Field( - default=None, - description=("Path in the container to retrieve an output parameter value from in" " container templates"), - ) - supplied: Optional[SuppliedValueFrom] = Field( - default=None, - description=("Supplied value to be filled in directly, either through the CLI, API, etc."), - ) + config_map_key_ref: Annotated[ + Optional[v1.ConfigMapKeySelector], + Field( + alias="configMapKeyRef", + description=("ConfigMapKeyRef is configmap selector for input parameter" " configuration"), + ), + ] = None + default: Annotated[ + Optional[str], + Field( + description=( + "Default specifies a value to be used if retrieving the value from the" " specified source fails" + ) + ), + ] = None + event: Annotated[ + Optional[str], + Field( + description=( + "Selector (https://github.com/antonmedv/expr) that is evaluated against" + " the event to get the value of the parameter. E.g. `payload.message`" + ) + ), + ] = None + expression: Annotated[ + Optional[str], + Field(description=("Expression, if defined, is evaluated to specify the value for the" " parameter")), + ] = None + jq_filter: Annotated[ + Optional[str], + Field( + alias="jqFilter", + description=("JQFilter expression against the resource object in resource templates"), + ), + ] = None + json_path: Annotated[ + Optional[str], + Field( + alias="jsonPath", + description=("JSONPath of a resource to retrieve an output parameter value from in" " resource templates"), + ), + ] = None + parameter: Annotated[ + Optional[str], + Field( + description=( + "Parameter reference to a step or dag task in which to retrieve an" + " output parameter value from (e.g. '{{steps.mystep.outputs.myparam}}')" + ) + ), + ] = None + path: Annotated[ + Optional[str], + Field( + description=("Path in the container to retrieve an output parameter value from in" " container templates") + ), + ] = None + supplied: Annotated[ + Optional[SuppliedValueFrom], + Field(description=("Supplied value to be filled in directly, either through the CLI, API," " etc.")), + ] = None -class WorkflowSubmitRequest(BaseModel): - namespace: Optional[str] = None - resource_kind: Optional[str] = Field(default=None, alias="resourceKind") - resource_name: Optional[str] = Field(default=None, alias="resourceName") - submit_options: Optional[SubmitOpts] = Field(default=None, alias="submitOptions") +class HTTPHeader(BaseModel): + name: str + value: Optional[str] = None + value_from: Annotated[Optional[HTTPHeaderSource], Field(alias="valueFrom")] = None class HTTPAuth(BaseModel): - basic_auth: Optional[BasicAuth] = Field(default=None, alias="basicAuth") - client_cert: Optional[ClientCertAuth] = Field(default=None, alias="clientCert") + basic_auth: Annotated[Optional[BasicAuth], Field(alias="basicAuth")] = None + client_cert: Annotated[Optional[ClientCertAuth], Field(alias="clientCert")] = None oauth2: Optional[OAuth2Auth] = None -class HTTPHeader(BaseModel): - name: str - value: Optional[str] = None - value_from: Optional[HTTPHeaderSource] = Field(default=None, alias="valueFrom") +class S3Artifact(BaseModel): + access_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accessKeySecret", + description=("AccessKeySecret is the secret selector to the bucket's access key"), + ), + ] = None + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + create_bucket_if_not_present: Annotated[ + Optional[CreateS3BucketOptions], + Field( + alias="createBucketIfNotPresent", + description=( + "CreateBucketIfNotPresent tells the driver to attempt to create the S3" + " bucket for output artifacts, if it doesn't exist. Setting Enabled" + " Encryption will apply either SSE-S3 to the bucket if KmsKeyId is not" + " set or SSE-KMS if it is." + ), + ), + ] = None + encryption_options: Annotated[Optional[S3EncryptionOptions], Field(alias="encryptionOptions")] = None + endpoint: Annotated[ + Optional[str], + Field(description="Endpoint is the hostname of the bucket endpoint"), + ] = None + insecure: Annotated[ + Optional[bool], + Field(description="Insecure will connect to the service with TLS"), + ] = None + key: Annotated[ + Optional[str], + Field(description="Key is the key in the bucket where the artifact resides"), + ] = None + region: Annotated[Optional[str], Field(description="Region contains the optional bucket region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + description=("RoleARN is the Amazon Resource Name (ARN) of the role to assume."), + ), + ] = None + secret_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="secretKeySecret", + description=("SecretKeySecret is the secret selector to the bucket's secret key"), + ), + ] = None + use_sdk_creds: Annotated[ + Optional[bool], + Field( + alias="useSDKCreds", + description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), + ), + ] = None -class Parameter(BaseModel): - default: Optional[str] = Field( - default=None, - description=("Default is the default value to use for an input parameter if a value was" " not supplied"), - ) - description: Optional[str] = Field(default=None, description="Description is the parameter description") - enum: Optional[List[str]] = Field( - default=None, - description=("Enum holds a list of string values to choose from, for the actual value of" " the parameter"), - ) - global_name: Optional[str] = Field( - default=None, - alias="globalName", - description=( - "GlobalName exports an output parameter to the global scope, making it" - " available as '{{io.argoproj.workflow.v1alpha1.outputs.parameters.XXXX}}" - " and in workflow.status.outputs.parameters" - ), - ) - name: str = Field(..., description="Name is the parameter name") - value: Optional[str] = Field( - default=None, - description=( - "Value is the literal value to use for the parameter. If specified in the" - " context of an input parameter, the value takes precedence over any passed" - " values" - ), - ) - value_from: Optional[ValueFrom] = Field( - default=None, - alias="valueFrom", - description="ValueFrom is the source for the output parameter's value", - ) +class S3ArtifactRepository(BaseModel): + access_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accessKeySecret", + description=("AccessKeySecret is the secret selector to the bucket's access key"), + ), + ] = None + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + create_bucket_if_not_present: Annotated[ + Optional[CreateS3BucketOptions], + Field( + alias="createBucketIfNotPresent", + description=( + "CreateBucketIfNotPresent tells the driver to attempt to create the S3" + " bucket for output artifacts, if it doesn't exist. Setting Enabled" + " Encryption will apply either SSE-S3 to the bucket if KmsKeyId is not" + " set or SSE-KMS if it is." + ), + ), + ] = None + encryption_options: Annotated[Optional[S3EncryptionOptions], Field(alias="encryptionOptions")] = None + endpoint: Annotated[ + Optional[str], + Field(description="Endpoint is the hostname of the bucket endpoint"), + ] = None + insecure: Annotated[ + Optional[bool], + Field(description="Insecure will connect to the service with TLS"), + ] = None + key_format: Annotated[ + Optional[str], + Field( + alias="keyFormat", + description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), + ), + ] = None + key_prefix: Annotated[ + Optional[str], + Field( + alias="keyPrefix", + description=( + "KeyPrefix is prefix used as part of the bucket key in which the" + " controller will store artifacts. DEPRECATED. Use KeyFormat instead" + ), + ), + ] = None + region: Annotated[Optional[str], Field(description="Region contains the optional bucket region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + description=("RoleARN is the Amazon Resource Name (ARN) of the role to assume."), + ), + ] = None + secret_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="secretKeySecret", + description=("SecretKeySecret is the secret selector to the bucket's secret key"), + ), + ] = None + use_sdk_creds: Annotated[ + Optional[bool], + Field( + alias="useSDKCreds", + description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), + ), + ] = None -class PodGC(BaseModel): - label_selector: Optional[v1_1.LabelSelector] = Field( - default=None, - alias="labelSelector", - description=( - "LabelSelector is the label selector to check if the pods match the labels" - " before being added to the pod GC queue." - ), - ) - strategy: Optional[str] = Field( - default=None, - description=( - 'Strategy is the strategy to use. One of "OnPodCompletion", "OnPodSuccess",' - ' "OnWorkflowCompletion", "OnWorkflowSuccess"' +class Memoize(BaseModel): + cache: Annotated[Cache, Field(description="Cache sets and configures the kind of cache")] + key: Annotated[str, Field(description="Key is the key to use as the caching key")] + max_age: Annotated[ + str, + Field( + alias="maxAge", + description=( + 'MaxAge is the maximum age (e.g. "180s", "24h") of an entry that is' + " still considered valid. If an entry is older than the MaxAge, it will" + " be ignored." + ), ), - ) + ] -class S3Artifact(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKeySecret", - description="AccessKeySecret is the secret selector to the bucket's access key", - ) - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - create_bucket_if_not_present: Optional[CreateS3BucketOptions] = Field( - default=None, - alias="createBucketIfNotPresent", - description=( - "CreateBucketIfNotPresent tells the driver to attempt to create the S3" - " bucket for output artifacts, if it doesn't exist. Setting Enabled" - " Encryption will apply either SSE-S3 to the bucket if KmsKeyId is not set" - " or SSE-KMS if it is." - ), - ) - encryption_options: Optional[S3EncryptionOptions] = Field(default=None, alias="encryptionOptions") - endpoint: Optional[str] = Field(default=None, description="Endpoint is the hostname of the bucket endpoint") - insecure: Optional[bool] = Field(default=None, description="Insecure will connect to the service with TLS") - key: Optional[str] = Field( - default=None, - description="Key is the key in the bucket where the artifact resides", - ) - region: Optional[str] = Field(default=None, description="Region contains the optional bucket region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - description="RoleARN is the Amazon Resource Name (ARN) of the role to assume.", - ) - secret_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKeySecret", - description="SecretKeySecret is the secret selector to the bucket's secret key", - ) - use_sdk_creds: Optional[bool] = Field( - default=None, - alias="useSDKCreds", - description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), - ) +class Synchronization(BaseModel): + mutex: Annotated[Optional[Mutex], Field(description="Mutex holds the Mutex lock details")] = None + semaphore: Annotated[ + Optional[SemaphoreRef], + Field(description="Semaphore holds the Semaphore configuration"), + ] = None -class S3ArtifactRepository(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKeySecret", - description="AccessKeySecret is the secret selector to the bucket's access key", - ) - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - create_bucket_if_not_present: Optional[CreateS3BucketOptions] = Field( - default=None, - alias="createBucketIfNotPresent", - description=( - "CreateBucketIfNotPresent tells the driver to attempt to create the S3" - " bucket for output artifacts, if it doesn't exist. Setting Enabled" - " Encryption will apply either SSE-S3 to the bucket if KmsKeyId is not set" - " or SSE-KMS if it is." - ), - ) - encryption_options: Optional[S3EncryptionOptions] = Field(default=None, alias="encryptionOptions") - endpoint: Optional[str] = Field(default=None, description="Endpoint is the hostname of the bucket endpoint") - insecure: Optional[bool] = Field(default=None, description="Insecure will connect to the service with TLS") - key_format: Optional[str] = Field( - default=None, - alias="keyFormat", - description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), - ) - key_prefix: Optional[str] = Field( - default=None, - alias="keyPrefix", - description=( - "KeyPrefix is prefix used as part of the bucket key in which the controller" - " will store artifacts. DEPRECATED. Use KeyFormat instead" - ), - ) - region: Optional[str] = Field(default=None, description="Region contains the optional bucket region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - description="RoleARN is the Amazon Resource Name (ARN) of the role to assume.", - ) - secret_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKeySecret", - description="SecretKeySecret is the secret selector to the bucket's secret key", - ) - use_sdk_creds: Optional[bool] = Field( - default=None, - alias="useSDKCreds", - description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), - ) +class RetryStrategy(BaseModel): + affinity: Annotated[ + Optional[RetryAffinity], + Field(description="Affinity prevents running workflow's step on the same host"), + ] = None + backoff: Annotated[Optional[Backoff], Field(description="Backoff is a backoff strategy")] = None + expression: Annotated[ + Optional[str], + Field( + description=( + "Expression is a condition expression for when a node will be retried." + " If it evaluates to false, the node will not be retried and the retry" + " strategy will be ignored" + ) + ), + ] = None + limit: Annotated[ + Optional[intstr.IntOrString], + Field( + description=( + "Limit is the maximum number of retry attempts when retrying a" + " container. It does not include the original container; the maximum" + " number of total attempts will be `limit + 1`." + ) + ), + ] = None + retry_policy: Annotated[ + Optional[str], + Field( + alias="retryPolicy", + description=("RetryPolicy is a policy of NodePhase statuses that will be retried"), + ), + ] = None -class ArtifactRepository(BaseModel): - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs enables log archiving", - ) - artifactory: Optional[ArtifactoryArtifactRepository] = Field( - default=None, description="Artifactory stores artifacts to JFrog Artifactory" - ) - azure: Optional[AzureArtifactRepository] = Field( - default=None, description="Azure stores artifact in an Azure Storage account" - ) - gcs: Optional[GCSArtifactRepository] = Field(default=None, description="GCS stores artifact in a GCS object store") - hdfs: Optional[HDFSArtifactRepository] = Field(default=None, description="HDFS stores artifacts in HDFS") - oss: Optional[OSSArtifactRepository] = Field( - default=None, description="OSS stores artifact in a OSS-compliant object store" - ) - s3: Optional[S3ArtifactRepository] = Field( - default=None, description="S3 stores artifact in a S3-compliant object store" - ) +class WorkflowSubmitRequest(BaseModel): + namespace: Optional[str] = None + resource_kind: Annotated[Optional[str], Field(alias="resourceKind")] = None + resource_name: Annotated[Optional[str], Field(alias="resourceName")] = None + submit_options: Annotated[Optional[SubmitOpts], Field(alias="submitOptions")] = None -class ArtifactRepositoryRefStatus(BaseModel): - artifact_repository: Optional[ArtifactRepository] = Field( - default=None, - alias="artifactRepository", - description=("The repository the workflow will use. This maybe empty before v3.1."), - ) - config_map: Optional[str] = Field( - default=None, - alias="configMap", - description='The name of the config map. Defaults to "artifact-repositories".', - ) - default: Optional[bool] = Field( - default=None, - description=("If this ref represents the default artifact repository, rather than a" " config map."), - ) - key: Optional[str] = Field( - default=None, - description=( - "The config map key. Defaults to the value of the" - ' "workflows.argoproj.io/default-artifact-repository" annotation.' - ), - ) - namespace: Optional[str] = Field( - default=None, - description=( - "The namespace of the config map. Defaults to the workflow's namespace, or" - " the controller's namespace (if found)." - ), - ) +class Parameter(BaseModel): + default: Annotated[ + Optional[str], + Field( + description=("Default is the default value to use for an input parameter if a value" " was not supplied") + ), + ] = None + description: Annotated[Optional[str], Field(description="Description is the parameter description")] = None + enum: Annotated[ + Optional[List[str]], + Field( + description=("Enum holds a list of string values to choose from, for the actual" " value of the parameter") + ), + ] = None + global_name: Annotated[ + Optional[str], + Field( + alias="globalName", + description=( + "GlobalName exports an output parameter to the global scope, making it" + " available as" + " '{{io.argoproj.workflow.v1alpha1.outputs.parameters.XXXX}} and in" + " workflow.status.outputs.parameters" + ), + ), + ] = None + name: Annotated[str, Field(description="Name is the parameter name")] + value: Annotated[ + Optional[str], + Field( + description=( + "Value is the literal value to use for the parameter. If specified in" + " the context of an input parameter, the value takes precedence over" + " any passed values" + ) + ), + ] = None + value_from: Annotated[ + Optional[ValueFrom], + Field( + alias="valueFrom", + description="ValueFrom is the source for the output parameter's value", + ), + ] = None -class HTTP(BaseModel): - body: Optional[str] = Field(default=None, description="Body is content of the HTTP Request") - body_from: Optional[HTTPBodySource] = Field( - default=None, - alias="bodyFrom", - description="BodyFrom is content of the HTTP Request as Bytes", - ) - headers: Optional[List[HTTPHeader]] = Field( - default=None, - description=("Headers are an optional list of headers to send with HTTP requests"), - ) - insecure_skip_verify: Optional[bool] = Field( - default=None, - alias="insecureSkipVerify", - description=( - "InsecureSkipVerify is a bool when if set to true will skip TLS" " verification for the HTTP client" - ), - ) - method: Optional[str] = Field(default=None, description="Method is HTTP methods for HTTP Request") - success_condition: Optional[str] = Field( - default=None, - alias="successCondition", - description=("SuccessCondition is an expression if evaluated to true is considered" " successful"), - ) - timeout_seconds: Optional[int] = Field( - default=None, - alias="timeoutSeconds", - description=("TimeoutSeconds is request timeout for HTTP Request. Default is 30 seconds"), - ) - url: str = Field(..., description="URL of the HTTP Request") +class HTTPArtifact(BaseModel): + auth: Annotated[ + Optional[HTTPAuth], + Field(description="Auth contains information for client authentication"), + ] = None + headers: Annotated[ + Optional[List[Header]], + Field(description=("Headers are an optional list of headers to send with HTTP requests for" " artifacts")), + ] = None + url: Annotated[str, Field(description="URL of the artifact")] -class HTTPArtifact(BaseModel): - auth: Optional[HTTPAuth] = Field(default=None, description="Auth contains information for client authentication") - headers: Optional[List[Header]] = Field( - default=None, - description=("Headers are an optional list of headers to send with HTTP requests for" " artifacts"), - ) - url: str = Field(..., description="URL of the artifact") +class ArtifactRepository(BaseModel): + archive_logs: Annotated[ + Optional[bool], + Field(alias="archiveLogs", description="ArchiveLogs enables log archiving"), + ] = None + artifactory: Annotated[ + Optional[ArtifactoryArtifactRepository], + Field(description="Artifactory stores artifacts to JFrog Artifactory"), + ] = None + azure: Annotated[ + Optional[AzureArtifactRepository], + Field(description="Azure stores artifact in an Azure Storage account"), + ] = None + gcs: Annotated[ + Optional[GCSArtifactRepository], + Field(description="GCS stores artifact in a GCS object store"), + ] = None + hdfs: Annotated[ + Optional[HDFSArtifactRepository], + Field(description="HDFS stores artifacts in HDFS"), + ] = None + oss: Annotated[ + Optional[OSSArtifactRepository], + Field(description="OSS stores artifact in a OSS-compliant object store"), + ] = None + s3: Annotated[ + Optional[S3ArtifactRepository], + Field(description="S3 stores artifact in a S3-compliant object store"), + ] = None class Artifact(BaseModel): - archive: Optional[ArchiveStrategy] = Field( - default=None, - description=("Archive controls how the artifact will be saved to the artifact" " repository."), - ) - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs indicates if the container logs should be archived", - ) - artifact_gc: Optional[ArtifactGC] = Field( - default=None, - alias="artifactGC", - description=( - "ArtifactGC describes the strategy to use when to deleting an artifact from" - " completed or deleted workflows" - ), - ) - artifactory: Optional[ArtifactoryArtifact] = Field( - default=None, - description="Artifactory contains artifactory artifact location details", - ) - azure: Optional[AzureArtifact] = Field( - default=None, - description="Azure contains Azure Storage artifact location details", - ) - deleted: Optional[bool] = Field(default=None, description="Has this been deleted?") - from_: Optional[str] = Field( - default=None, - alias="from", - description=("From allows an artifact to reference an artifact from a previous step"), - ) - from_expression: Optional[str] = Field( - default=None, - alias="fromExpression", - description=("FromExpression, if defined, is evaluated to specify the value for the" " artifact"), - ) - gcs: Optional[GCSArtifact] = Field(default=None, description="GCS contains GCS artifact location details") - git: Optional[GitArtifact] = Field(default=None, description="Git contains git artifact location details") - global_name: Optional[str] = Field( - default=None, - alias="globalName", - description=( - "GlobalName exports an output artifact to the global scope, making it" - " available as '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}}" - " and in workflow.status.outputs.artifacts" - ), - ) - hdfs: Optional[HDFSArtifact] = Field(default=None, description="HDFS contains HDFS artifact location details") - http: Optional[HTTPArtifact] = Field(default=None, description="HTTP contains HTTP artifact location details") - mode: Optional[int] = Field( - default=None, - description=( - "mode bits to use on this file, must be a value between 0 and 0777 set when" " loading input artifacts." - ), - ) - name: str = Field( - ..., - description=("name of the artifact. must be unique within a template's inputs/outputs."), - ) - optional: Optional[bool] = Field( - default=None, - description="Make Artifacts optional, if Artifacts doesn't generate or exist", - ) - oss: Optional[OSSArtifact] = Field(default=None, description="OSS contains OSS artifact location details") - path: Optional[str] = Field(default=None, description="Path is the container path to the artifact") - raw: Optional[RawArtifact] = Field(default=None, description="Raw contains raw artifact location details") - recurse_mode: Optional[bool] = Field( - default=None, - alias="recurseMode", - description=("If mode is set, apply the permission recursively into the artifact if it" " is a folder"), - ) - s3: Optional[S3Artifact] = Field(default=None, description="S3 contains S3 artifact location details") - sub_path: Optional[str] = Field( - default=None, - alias="subPath", - description=("SubPath allows an artifact to be sourced from a subpath within the" " specified source"), - ) + archive: Annotated[ + Optional[ArchiveStrategy], + Field(description=("Archive controls how the artifact will be saved to the artifact" " repository.")), + ] = None + archive_logs: Annotated[ + Optional[bool], + Field( + alias="archiveLogs", + description=("ArchiveLogs indicates if the container logs should be archived"), + ), + ] = None + artifact_gc: Annotated[ + Optional[ArtifactGC], + Field( + alias="artifactGC", + description=( + "ArtifactGC describes the strategy to use when to deleting an artifact" + " from completed or deleted workflows" + ), + ), + ] = None + artifactory: Annotated[ + Optional[ArtifactoryArtifact], + Field(description="Artifactory contains artifactory artifact location details"), + ] = None + azure: Annotated[ + Optional[AzureArtifact], + Field(description="Azure contains Azure Storage artifact location details"), + ] = None + deleted: Annotated[Optional[bool], Field(description="Has this been deleted?")] = None + from_: Annotated[ + Optional[str], + Field( + alias="from", + description=("From allows an artifact to reference an artifact from a previous step"), + ), + ] = None + from_expression: Annotated[ + Optional[str], + Field( + alias="fromExpression", + description=("FromExpression, if defined, is evaluated to specify the value for the" " artifact"), + ), + ] = None + gcs: Annotated[ + Optional[GCSArtifact], + Field(description="GCS contains GCS artifact location details"), + ] = None + git: Annotated[ + Optional[GitArtifact], + Field(description="Git contains git artifact location details"), + ] = None + global_name: Annotated[ + Optional[str], + Field( + alias="globalName", + description=( + "GlobalName exports an output artifact to the global scope, making it" + " available as" + " '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}} and in" + " workflow.status.outputs.artifacts" + ), + ), + ] = None + hdfs: Annotated[ + Optional[HDFSArtifact], + Field(description="HDFS contains HDFS artifact location details"), + ] = None + http: Annotated[ + Optional[HTTPArtifact], + Field(description="HTTP contains HTTP artifact location details"), + ] = None + mode: Annotated[ + Optional[int], + Field( + description=( + "mode bits to use on this file, must be a value between 0 and 0777 set" + " when loading input artifacts." + ) + ), + ] = None + name: Annotated[ + str, + Field(description=("name of the artifact. must be unique within a template's" " inputs/outputs.")), + ] + optional: Annotated[ + Optional[bool], + Field(description=("Make Artifacts optional, if Artifacts doesn't generate or exist")), + ] = None + oss: Annotated[ + Optional[OSSArtifact], + Field(description="OSS contains OSS artifact location details"), + ] = None + path: Annotated[Optional[str], Field(description="Path is the container path to the artifact")] = None + raw: Annotated[ + Optional[RawArtifact], + Field(description="Raw contains raw artifact location details"), + ] = None + recurse_mode: Annotated[ + Optional[bool], + Field( + alias="recurseMode", + description=("If mode is set, apply the permission recursively into the artifact if" " it is a folder"), + ), + ] = None + s3: Annotated[ + Optional[S3Artifact], + Field(description="S3 contains S3 artifact location details"), + ] = None + sub_path: Annotated[ + Optional[str], + Field( + alias="subPath", + description=("SubPath allows an artifact to be sourced from a subpath within the" " specified source"), + ), + ] = None class ArtifactLocation(BaseModel): - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs indicates if the container logs should be archived", - ) - artifactory: Optional[ArtifactoryArtifact] = Field( - default=None, - description="Artifactory contains artifactory artifact location details", - ) - azure: Optional[AzureArtifact] = Field( - default=None, - description="Azure contains Azure Storage artifact location details", - ) - gcs: Optional[GCSArtifact] = Field(default=None, description="GCS contains GCS artifact location details") - git: Optional[GitArtifact] = Field(default=None, description="Git contains git artifact location details") - hdfs: Optional[HDFSArtifact] = Field(default=None, description="HDFS contains HDFS artifact location details") - http: Optional[HTTPArtifact] = Field(default=None, description="HTTP contains HTTP artifact location details") - oss: Optional[OSSArtifact] = Field(default=None, description="OSS contains OSS artifact location details") - raw: Optional[RawArtifact] = Field(default=None, description="Raw contains raw artifact location details") - s3: Optional[S3Artifact] = Field(default=None, description="S3 contains S3 artifact location details") + archive_logs: Annotated[ + Optional[bool], + Field( + alias="archiveLogs", + description=("ArchiveLogs indicates if the container logs should be archived"), + ), + ] = None + artifactory: Annotated[ + Optional[ArtifactoryArtifact], + Field(description="Artifactory contains artifactory artifact location details"), + ] = None + azure: Annotated[ + Optional[AzureArtifact], + Field(description="Azure contains Azure Storage artifact location details"), + ] = None + gcs: Annotated[ + Optional[GCSArtifact], + Field(description="GCS contains GCS artifact location details"), + ] = None + git: Annotated[ + Optional[GitArtifact], + Field(description="Git contains git artifact location details"), + ] = None + hdfs: Annotated[ + Optional[HDFSArtifact], + Field(description="HDFS contains HDFS artifact location details"), + ] = None + http: Annotated[ + Optional[HTTPArtifact], + Field(description="HTTP contains HTTP artifact location details"), + ] = None + oss: Annotated[ + Optional[OSSArtifact], + Field(description="OSS contains OSS artifact location details"), + ] = None + raw: Annotated[ + Optional[RawArtifact], + Field(description="Raw contains raw artifact location details"), + ] = None + s3: Annotated[ + Optional[S3Artifact], + Field(description="S3 contains S3 artifact location details"), + ] = None -class ArtifactNodeSpec(BaseModel): - archive_location: Optional[ArtifactLocation] = Field( - default=None, - alias="archiveLocation", - description=("ArchiveLocation is the template-level Artifact location specification"), - ) - artifacts: Optional[Dict[str, Artifact]] = Field( - default=None, description="Artifacts maps artifact name to Artifact description" - ) +class ArtifactPaths(BaseModel): + archive: Annotated[ + Optional[ArchiveStrategy], + Field(description=("Archive controls how the artifact will be saved to the artifact" " repository.")), + ] = None + archive_logs: Annotated[ + Optional[bool], + Field( + alias="archiveLogs", + description=("ArchiveLogs indicates if the container logs should be archived"), + ), + ] = None + artifact_gc: Annotated[ + Optional[ArtifactGC], + Field( + alias="artifactGC", + description=( + "ArtifactGC describes the strategy to use when to deleting an artifact" + " from completed or deleted workflows" + ), + ), + ] = None + artifactory: Annotated[ + Optional[ArtifactoryArtifact], + Field(description="Artifactory contains artifactory artifact location details"), + ] = None + azure: Annotated[ + Optional[AzureArtifact], + Field(description="Azure contains Azure Storage artifact location details"), + ] = None + deleted: Annotated[Optional[bool], Field(description="Has this been deleted?")] = None + from_: Annotated[ + Optional[str], + Field( + alias="from", + description=("From allows an artifact to reference an artifact from a previous step"), + ), + ] = None + from_expression: Annotated[ + Optional[str], + Field( + alias="fromExpression", + description=("FromExpression, if defined, is evaluated to specify the value for the" " artifact"), + ), + ] = None + gcs: Annotated[ + Optional[GCSArtifact], + Field(description="GCS contains GCS artifact location details"), + ] = None + git: Annotated[ + Optional[GitArtifact], + Field(description="Git contains git artifact location details"), + ] = None + global_name: Annotated[ + Optional[str], + Field( + alias="globalName", + description=( + "GlobalName exports an output artifact to the global scope, making it" + " available as" + " '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}} and in" + " workflow.status.outputs.artifacts" + ), + ), + ] = None + hdfs: Annotated[ + Optional[HDFSArtifact], + Field(description="HDFS contains HDFS artifact location details"), + ] = None + http: Annotated[ + Optional[HTTPArtifact], + Field(description="HTTP contains HTTP artifact location details"), + ] = None + mode: Annotated[ + Optional[int], + Field( + description=( + "mode bits to use on this file, must be a value between 0 and 0777 set" + " when loading input artifacts." + ) + ), + ] = None + name: Annotated[ + str, + Field(description=("name of the artifact. must be unique within a template's" " inputs/outputs.")), + ] + optional: Annotated[ + Optional[bool], + Field(description=("Make Artifacts optional, if Artifacts doesn't generate or exist")), + ] = None + oss: Annotated[ + Optional[OSSArtifact], + Field(description="OSS contains OSS artifact location details"), + ] = None + path: Annotated[Optional[str], Field(description="Path is the container path to the artifact")] = None + raw: Annotated[ + Optional[RawArtifact], + Field(description="Raw contains raw artifact location details"), + ] = None + recurse_mode: Annotated[ + Optional[bool], + Field( + alias="recurseMode", + description=("If mode is set, apply the permission recursively into the artifact if" " it is a folder"), + ), + ] = None + s3: Annotated[ + Optional[S3Artifact], + Field(description="S3 contains S3 artifact location details"), + ] = None + sub_path: Annotated[ + Optional[str], + Field( + alias="subPath", + description=("SubPath allows an artifact to be sourced from a subpath within the" " specified source"), + ), + ] = None -class ArtifactPaths(BaseModel): - archive: Optional[ArchiveStrategy] = Field( - default=None, - description=("Archive controls how the artifact will be saved to the artifact" " repository."), - ) - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs indicates if the container logs should be archived", - ) - artifact_gc: Optional[ArtifactGC] = Field( - default=None, - alias="artifactGC", - description=( - "ArtifactGC describes the strategy to use when to deleting an artifact from" - " completed or deleted workflows" - ), - ) - artifactory: Optional[ArtifactoryArtifact] = Field( - default=None, - description="Artifactory contains artifactory artifact location details", - ) - azure: Optional[AzureArtifact] = Field( - default=None, - description="Azure contains Azure Storage artifact location details", - ) - deleted: Optional[bool] = Field(default=None, description="Has this been deleted?") - from_: Optional[str] = Field( - default=None, - alias="from", - description=("From allows an artifact to reference an artifact from a previous step"), - ) - from_expression: Optional[str] = Field( - default=None, - alias="fromExpression", - description=("FromExpression, if defined, is evaluated to specify the value for the" " artifact"), - ) - gcs: Optional[GCSArtifact] = Field(default=None, description="GCS contains GCS artifact location details") - git: Optional[GitArtifact] = Field(default=None, description="Git contains git artifact location details") - global_name: Optional[str] = Field( - default=None, - alias="globalName", - description=( - "GlobalName exports an output artifact to the global scope, making it" - " available as '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}}" - " and in workflow.status.outputs.artifacts" - ), - ) - hdfs: Optional[HDFSArtifact] = Field(default=None, description="HDFS contains HDFS artifact location details") - http: Optional[HTTPArtifact] = Field(default=None, description="HTTP contains HTTP artifact location details") - mode: Optional[int] = Field( - default=None, - description=( - "mode bits to use on this file, must be a value between 0 and 0777 set when" " loading input artifacts." - ), - ) - name: str = Field( - ..., - description=("name of the artifact. must be unique within a template's inputs/outputs."), - ) - optional: Optional[bool] = Field( - default=None, - description="Make Artifacts optional, if Artifacts doesn't generate or exist", - ) - oss: Optional[OSSArtifact] = Field(default=None, description="OSS contains OSS artifact location details") - path: Optional[str] = Field(default=None, description="Path is the container path to the artifact") - raw: Optional[RawArtifact] = Field(default=None, description="Raw contains raw artifact location details") - recurse_mode: Optional[bool] = Field( - default=None, - alias="recurseMode", - description=("If mode is set, apply the permission recursively into the artifact if it" " is a folder"), - ) - s3: Optional[S3Artifact] = Field(default=None, description="S3 contains S3 artifact location details") - sub_path: Optional[str] = Field( - default=None, - alias="subPath", - description=("SubPath allows an artifact to be sourced from a subpath within the" " specified source"), - ) +class ArtifactRepositoryRefStatus(BaseModel): + artifact_repository: Annotated[ + Optional[ArtifactRepository], + Field( + alias="artifactRepository", + description=("The repository the workflow will use. This maybe empty before v3.1."), + ), + ] = None + config_map: Annotated[ + Optional[str], + Field( + alias="configMap", + description=('The name of the config map. Defaults to "artifact-repositories".'), + ), + ] = None + default: Annotated[ + Optional[bool], + Field(description=("If this ref represents the default artifact repository, rather than a" " config map.")), + ] = None + key: Annotated[ + Optional[str], + Field( + description=( + "The config map key. Defaults to the value of the" + ' "workflows.argoproj.io/default-artifact-repository" annotation.' + ) + ), + ] = None + namespace: Annotated[ + Optional[str], + Field( + description=( + "The namespace of the config map. Defaults to the workflow's namespace," + " or the controller's namespace (if found)." + ) + ), + ] = None -class ContainerNode(BaseModel): - args: Optional[List[str]] = Field( - default=None, - description=( - "Arguments to the entrypoint. The container image's CMD is used if this is" - " not provided. Variable references $(VAR_NAME) are expanded using the" - " container's environment. If a variable cannot be resolved, the reference" - " in the input string will be unchanged. Double $$ are reduced to a single" - ' $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)"' - ' will produce the string literal "$(VAR_NAME)". Escaped references will' - " never be expanded, regardless of whether the variable exists or not." - " Cannot be updated. More info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - command: Optional[List[str]] = Field( - default=None, - description=( - "Entrypoint array. Not executed within a shell. The container image's" - " ENTRYPOINT is used if this is not provided. Variable references" - " $(VAR_NAME) are expanded using the container's environment. If a" - " variable cannot be resolved, the reference in the input string will be" - " unchanged. Double $$ are reduced to a single $, which allows for escaping" - ' the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string' - ' literal "$(VAR_NAME)". Escaped references will never be expanded,' - " regardless of whether the variable exists or not. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - dependencies: Optional[List[str]] = None - env: Optional[List[v1.EnvVar]] = Field( - default=None, - description=("List of environment variables to set in the container. Cannot be updated."), - ) - env_from: Optional[List[v1.EnvFromSource]] = Field( - default=None, - alias="envFrom", - description=( - "List of sources to populate environment variables in the container. The" - " keys defined within a source must be a C_IDENTIFIER. All invalid keys" - " will be reported as an event when the container is starting. When a key" - " exists in multiple sources, the value associated with the last source" - " will take precedence. Values defined by an Env with a duplicate key will" - " take precedence. Cannot be updated." - ), - ) - image: Optional[str] = Field( - default=None, - description=( - "Container image name. More info:" - " https://kubernetes.io/docs/concepts/containers/images This field is" - " optional to allow higher level config management to default or override" - " container images in workload controllers like Deployments and" - " StatefulSets." - ), - ) - image_pull_policy: Optional[str] = Field( - default=None, - alias="imagePullPolicy", - description=( - "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always" - " if :latest tag is specified, or IfNotPresent otherwise. Cannot be" - " updated. More info:" - " https://kubernetes.io/docs/concepts/containers/images#updating-images" - ), - ) - lifecycle: Optional[v1.Lifecycle] = Field( - default=None, - description=( - "Actions that the management system should take in response to container" - " lifecycle events. Cannot be updated." - ), - ) - liveness_probe: Optional[v1.Probe] = Field( - default=None, - alias="livenessProbe", - description=( - "Periodic probe of container liveness. Container will be restarted if the" - " probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - name: str = Field( - ..., - description=( - "Name of the container specified as a DNS_LABEL. Each container in a pod" - " must have a unique name (DNS_LABEL). Cannot be updated." - ), - ) - ports: Optional[List[v1.ContainerPort]] = Field( - default=None, - description=( - "List of ports to expose from the container. Exposing a port here gives the" - " system additional information about the network connections a container" - " uses, but is primarily informational. Not specifying a port here DOES NOT" - " prevent that port from being exposed. Any port which is listening on the" - ' default "0.0.0.0" address inside a container will be accessible from the' - " network. Cannot be updated." - ), - ) - readiness_probe: Optional[v1.Probe] = Field( - default=None, - alias="readinessProbe", - description=( - "Periodic probe of container service readiness. Container will be removed" - " from service endpoints if the probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - resources: Optional[v1.ResourceRequirements] = Field( - default=None, - description=( - "Compute Resources required by this container. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - security_context: Optional[v1.SecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext defines the security options the container should be run" - " with. If set, the fields of SecurityContext override the equivalent" - " fields of PodSecurityContext. More info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" - ), - ) - startup_probe: Optional[v1.Probe] = Field( - default=None, - alias="startupProbe", - description=( - "StartupProbe indicates that the Pod has successfully initialized. If" - " specified, no other probes are executed until this completes" - " successfully. If this probe fails, the Pod will be restarted, just as if" - " the livenessProbe failed. This can be used to provide different probe" - " parameters at the beginning of a Pod's lifecycle, when it might take a" - " long time to load data or warm a cache, than during steady-state" - " operation. This cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - stdin: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a buffer for stdin in the container" - " runtime. If this is not set, reads from stdin in the container will" - " always result in EOF. Default is false." - ), - ) - stdin_once: Optional[bool] = Field( - default=None, - alias="stdinOnce", - description=( - "Whether the container runtime should close the stdin channel after it has" - " been opened by a single attach. When stdin is true the stdin stream will" - " remain open across multiple attach sessions. If stdinOnce is set to true," - " stdin is opened on container start, is empty until the first client" - " attaches to stdin, and then remains open and accepts data until the" - " client disconnects, at which time stdin is closed and remains closed" - " until the container is restarted. If this flag is false, a container" - " processes that reads from stdin will never receive an EOF. Default is" - " false" - ), - ) - termination_message_path: Optional[str] = Field( - default=None, - alias="terminationMessagePath", - description=( - "Optional: Path at which the file to which the container's termination" - " message will be written is mounted into the container's filesystem." - " Message written is intended to be brief final status, such as an" - " assertion failure message. Will be truncated by the node if greater than" - " 4096 bytes. The total message length across all containers will be" - " limited to 12kb. Defaults to /dev/termination-log. Cannot be updated." - ), - ) - termination_message_policy: Optional[str] = Field( - default=None, - alias="terminationMessagePolicy", - description=( - "Indicate how the termination message should be populated. File will use" - " the contents of terminationMessagePath to populate the container status" - " message on both success and failure. FallbackToLogsOnError will use the" - " last chunk of container log output if the termination message file is" - " empty and the container exited with an error. The log output is limited" - " to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot" - " be updated." - ), - ) - tty: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a TTY for itself, also requires" - " 'stdin' to be true. Default is false." - ), - ) - volume_devices: Optional[List[v1.VolumeDevice]] = Field( - default=None, - alias="volumeDevices", - description=("volumeDevices is the list of block devices to be used by the container."), - ) - volume_mounts: Optional[List[v1.VolumeMount]] = Field( - default=None, - alias="volumeMounts", - description=("Pod volumes to mount into the container's filesystem. Cannot be updated."), - ) - working_dir: Optional[str] = Field( - default=None, - alias="workingDir", - description=( - "Container's working directory. If not specified, the container runtime's" - " default will be used, which might be configured in the container image." - " Cannot be updated." - ), - ) +class ManifestFrom(BaseModel): + artifact: Annotated[Artifact, Field(description="Artifact contains the artifact to use")] -class ContainerSetTemplate(BaseModel): - containers: List[ContainerNode] - retry_strategy: Optional[ContainerSetRetryStrategy] = Field( - default=None, - alias="retryStrategy", - description=( - "RetryStrategy describes how to retry a container nodes in the container" - " set if it fails. Nbr of retries(default 0) and sleep duration between" - " retries(default 0s, instant retry) can be set." +class ArtifactNodeSpec(BaseModel): + archive_location: Annotated[ + Optional[ArtifactLocation], + Field( + alias="archiveLocation", + description=("ArchiveLocation is the template-level Artifact location specification"), ), - ) - volume_mounts: Optional[List[v1.VolumeMount]] = Field(default=None, alias="volumeMounts") + ] = None + artifacts: Annotated[ + Optional[Dict[str, Artifact]], + Field(description="Artifacts maps artifact name to Artifact description"), + ] = None class DataSource(BaseModel): - artifact_paths: Optional[ArtifactPaths] = Field( - default=None, - alias="artifactPaths", - description=("ArtifactPaths is a data transformation that collects a list of artifact" " paths"), - ) + artifact_paths: Annotated[ + Optional[ArtifactPaths], + Field( + alias="artifactPaths", + description=("ArtifactPaths is a data transformation that collects a list of" " artifact paths"), + ), + ] = None -class Inputs(BaseModel): - artifacts: Optional[List[Artifact]] = Field( - default=None, description="Artifact are a list of artifacts passed as inputs" - ) - parameters: Optional[List[Parameter]] = Field( - default=None, description="Parameters are a list of parameters passed as inputs" - ) +class ResourceTemplate(BaseModel): + action: Annotated[ + str, + Field( + description=( + "Action is the action to perform to the resource. Must be one of: get," + " create, apply, delete, replace, patch" + ) + ), + ] + failure_condition: Annotated[ + Optional[str], + Field( + alias="failureCondition", + description=( + "FailureCondition is a label selector expression which describes the" + " conditions of the k8s resource in which the step was considered" + " failed" + ), + ), + ] = None + flags: Annotated[ + Optional[List[str]], + Field( + description=( + "Flags is a set of additional options passed to kubectl before" + " submitting a resource I.e. to disable resource validation: flags:" + ' [\n\t"--validate=false" # disable resource validation\n]' + ) + ), + ] = None + manifest: Annotated[Optional[str], Field(description="Manifest contains the kubernetes manifest")] = None + manifest_from: Annotated[ + Optional[ManifestFrom], + Field( + alias="manifestFrom", + description="ManifestFrom is the source for a single kubernetes manifest", + ), + ] = None + merge_strategy: Annotated[ + Optional[str], + Field( + alias="mergeStrategy", + description=( + "MergeStrategy is the strategy used to merge a patch. It defaults to" + ' "strategic" Must be one of: strategic, merge, json' + ), + ), + ] = None + set_owner_reference: Annotated[ + Optional[bool], + Field( + alias="setOwnerReference", + description=( + "SetOwnerReference sets the reference to the workflow on the" " OwnerReference of generated resource." + ), + ), + ] = None + success_condition: Annotated[ + Optional[str], + Field( + alias="successCondition", + description=( + "SuccessCondition is a label selector expression which describes the" + " conditions of the k8s resource in which it is acceptable to proceed" + " to the following step" + ), + ), + ] = None -class ManifestFrom(BaseModel): - artifact: Artifact = Field(..., description="Artifact contains the artifact to use") +class Data(BaseModel): + source: Annotated[ + DataSource, + Field(description="Source sources external data into a data template"), + ] + transformation: Annotated[ + List[TransformationStep], + Field(description="Transformation applies a set of transformations"), + ] -class Outputs(BaseModel): - artifacts: Optional[List[Artifact]] = Field( - default=None, - description="Artifacts holds the list of output artifacts produced by a step", - ) - exit_code: Optional[str] = Field( - default=None, - alias="exitCode", - description="ExitCode holds the exit code of a script template", - ) - parameters: Optional[List[Parameter]] = Field( - default=None, - description="Parameters holds the list of output parameters produced by a step", - ) - result: Optional[str] = Field( - default=None, - description="Result holds the result (stdout) of a script template", - ) +class Arguments(BaseModel): + artifacts: Annotated[ + Optional[List[Artifact]], + Field(description=("Artifacts is the list of artifacts to pass to the template or workflow")), + ] = None + parameters: Annotated[ + Optional[List[Parameter]], + Field(description=("Parameters is the list of parameters to pass to the template or" " workflow")), + ] = None -class ResourceTemplate(BaseModel): - action: str = Field( - ..., - description=( - "Action is the action to perform to the resource. Must be one of: get," - " create, apply, delete, replace, patch" - ), - ) - failure_condition: Optional[str] = Field( - default=None, - alias="failureCondition", - description=( - "FailureCondition is a label selector expression which describes the" - " conditions of the k8s resource in which the step was considered failed" - ), - ) - flags: Optional[List[str]] = Field( - default=None, - description=( - "Flags is a set of additional options passed to kubectl before submitting a" - " resource I.e. to disable resource validation: flags:" - ' [\n\t"--validate=false" # disable resource validation\n]' - ), - ) - manifest: Optional[str] = Field(default=None, description="Manifest contains the kubernetes manifest") - manifest_from: Optional[ManifestFrom] = Field( - default=None, - alias="manifestFrom", - description="ManifestFrom is the source for a single kubernetes manifest", - ) - merge_strategy: Optional[str] = Field( - default=None, - alias="mergeStrategy", - description=( - "MergeStrategy is the strategy used to merge a patch. It defaults to" - ' "strategic" Must be one of: strategic, merge, json' - ), - ) - set_owner_reference: Optional[bool] = Field( - default=None, - alias="setOwnerReference", - description=( - "SetOwnerReference sets the reference to the workflow on the OwnerReference" " of generated resource." - ), - ) - success_condition: Optional[str] = Field( - default=None, - alias="successCondition", - description=( - "SuccessCondition is a label selector expression which describes the" - " conditions of the k8s resource in which it is acceptable to proceed to" - " the following step" - ), - ) +class ArtifactGCSpec(BaseModel): + artifacts_by_node: Annotated[ + Optional[Dict[str, ArtifactNodeSpec]], + Field( + alias="artifactsByNode", + description=("ArtifactsByNode maps Node name to information pertaining to Artifacts" " on that Node"), + ), + ] = None -class ScriptTemplate(BaseModel): - args: Optional[List[str]] = Field( - default=None, - description=( - "Arguments to the entrypoint. The container image's CMD is used if this is" - " not provided. Variable references $(VAR_NAME) are expanded using the" - " container's environment. If a variable cannot be resolved, the reference" - " in the input string will be unchanged. Double $$ are reduced to a single" - ' $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)"' - ' will produce the string literal "$(VAR_NAME)". Escaped references will' - " never be expanded, regardless of whether the variable exists or not." - " Cannot be updated. More info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - command: Optional[List[str]] = Field( - default=None, - description=( - "Entrypoint array. Not executed within a shell. The container image's" - " ENTRYPOINT is used if this is not provided. Variable references" - " $(VAR_NAME) are expanded using the container's environment. If a" - " variable cannot be resolved, the reference in the input string will be" - " unchanged. Double $$ are reduced to a single $, which allows for escaping" - ' the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string' - ' literal "$(VAR_NAME)". Escaped references will never be expanded,' - " regardless of whether the variable exists or not. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - env: Optional[List[v1.EnvVar]] = Field( - default=None, - description=("List of environment variables to set in the container. Cannot be updated."), - ) - env_from: Optional[List[v1.EnvFromSource]] = Field( - default=None, - alias="envFrom", - description=( - "List of sources to populate environment variables in the container. The" - " keys defined within a source must be a C_IDENTIFIER. All invalid keys" - " will be reported as an event when the container is starting. When a key" - " exists in multiple sources, the value associated with the last source" - " will take precedence. Values defined by an Env with a duplicate key will" - " take precedence. Cannot be updated." - ), - ) - image: str = Field( - ..., - description=( - "Container image name. More info:" - " https://kubernetes.io/docs/concepts/containers/images This field is" - " optional to allow higher level config management to default or override" - " container images in workload controllers like Deployments and" - " StatefulSets." - ), - ) - image_pull_policy: Optional[str] = Field( - default=None, - alias="imagePullPolicy", - description=( - "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always" - " if :latest tag is specified, or IfNotPresent otherwise. Cannot be" - " updated. More info:" - " https://kubernetes.io/docs/concepts/containers/images#updating-images" - ), - ) - lifecycle: Optional[v1.Lifecycle] = Field( - default=None, - description=( - "Actions that the management system should take in response to container" - " lifecycle events. Cannot be updated." - ), - ) - liveness_probe: Optional[v1.Probe] = Field( - default=None, - alias="livenessProbe", - description=( - "Periodic probe of container liveness. Container will be restarted if the" - " probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the container specified as a DNS_LABEL. Each container in a pod" - " must have a unique name (DNS_LABEL). Cannot be updated." - ), - ) - ports: Optional[List[v1.ContainerPort]] = Field( - default=None, - description=( - "List of ports to expose from the container. Exposing a port here gives the" - " system additional information about the network connections a container" - " uses, but is primarily informational. Not specifying a port here DOES NOT" - " prevent that port from being exposed. Any port which is listening on the" - ' default "0.0.0.0" address inside a container will be accessible from the' - " network. Cannot be updated." - ), - ) - readiness_probe: Optional[v1.Probe] = Field( - default=None, - alias="readinessProbe", - description=( - "Periodic probe of container service readiness. Container will be removed" - " from service endpoints if the probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - resources: Optional[v1.ResourceRequirements] = Field( - default=None, - description=( - "Compute Resources required by this container. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - security_context: Optional[v1.SecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext defines the security options the container should be run" - " with. If set, the fields of SecurityContext override the equivalent" - " fields of PodSecurityContext. More info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" - ), - ) - source: str = Field(..., description="Source contains the source code of the script to execute") - startup_probe: Optional[v1.Probe] = Field( - default=None, - alias="startupProbe", - description=( - "StartupProbe indicates that the Pod has successfully initialized. If" - " specified, no other probes are executed until this completes" - " successfully. If this probe fails, the Pod will be restarted, just as if" - " the livenessProbe failed. This can be used to provide different probe" - " parameters at the beginning of a Pod's lifecycle, when it might take a" - " long time to load data or warm a cache, than during steady-state" - " operation. This cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - stdin: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a buffer for stdin in the container" - " runtime. If this is not set, reads from stdin in the container will" - " always result in EOF. Default is false." - ), - ) - stdin_once: Optional[bool] = Field( - default=None, - alias="stdinOnce", - description=( - "Whether the container runtime should close the stdin channel after it has" - " been opened by a single attach. When stdin is true the stdin stream will" - " remain open across multiple attach sessions. If stdinOnce is set to true," - " stdin is opened on container start, is empty until the first client" - " attaches to stdin, and then remains open and accepts data until the" - " client disconnects, at which time stdin is closed and remains closed" - " until the container is restarted. If this flag is false, a container" - " processes that reads from stdin will never receive an EOF. Default is" - " false" - ), - ) - termination_message_path: Optional[str] = Field( - default=None, - alias="terminationMessagePath", - description=( - "Optional: Path at which the file to which the container's termination" - " message will be written is mounted into the container's filesystem." - " Message written is intended to be brief final status, such as an" - " assertion failure message. Will be truncated by the node if greater than" - " 4096 bytes. The total message length across all containers will be" - " limited to 12kb. Defaults to /dev/termination-log. Cannot be updated." - ), - ) - termination_message_policy: Optional[str] = Field( - default=None, - alias="terminationMessagePolicy", - description=( - "Indicate how the termination message should be populated. File will use" - " the contents of terminationMessagePath to populate the container status" - " message on both success and failure. FallbackToLogsOnError will use the" - " last chunk of container log output if the termination message file is" - " empty and the container exited with an error. The log output is limited" - " to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot" - " be updated." - ), - ) - tty: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a TTY for itself, also requires" - " 'stdin' to be true. Default is false." - ), - ) - volume_devices: Optional[List[v1.VolumeDevice]] = Field( - default=None, - alias="volumeDevices", - description=("volumeDevices is the list of block devices to be used by the container."), - ) - volume_mounts: Optional[List[v1.VolumeMount]] = Field( - default=None, - alias="volumeMounts", - description=("Pod volumes to mount into the container's filesystem. Cannot be updated."), - ) - working_dir: Optional[str] = Field( - default=None, - alias="workingDir", - description=( - "Container's working directory. If not specified, the container runtime's" - " default will be used, which might be configured in the container image." - " Cannot be updated." - ), - ) +class ArtifactGCStatus(BaseModel): + artifact_results_by_node: Annotated[ + Optional[Dict[str, ArtifactResultNodeStatus]], + Field( + alias="artifactResultsByNode", + description="ArtifactResultsByNode maps Node name to result", + ), + ] = None -class UserContainer(BaseModel): - args: Optional[List[str]] = Field( - default=None, - description=( - "Arguments to the entrypoint. The container image's CMD is used if this is" - " not provided. Variable references $(VAR_NAME) are expanded using the" - " container's environment. If a variable cannot be resolved, the reference" - " in the input string will be unchanged. Double $$ are reduced to a single" - ' $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)"' - ' will produce the string literal "$(VAR_NAME)". Escaped references will' - " never be expanded, regardless of whether the variable exists or not." - " Cannot be updated. More info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - command: Optional[List[str]] = Field( - default=None, - description=( - "Entrypoint array. Not executed within a shell. The container image's" - " ENTRYPOINT is used if this is not provided. Variable references" - " $(VAR_NAME) are expanded using the container's environment. If a" - " variable cannot be resolved, the reference in the input string will be" - " unchanged. Double $$ are reduced to a single $, which allows for escaping" - ' the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string' - ' literal "$(VAR_NAME)". Escaped references will never be expanded,' - " regardless of whether the variable exists or not. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - env: Optional[List[v1.EnvVar]] = Field( - default=None, - description=("List of environment variables to set in the container. Cannot be updated."), - ) - env_from: Optional[List[v1.EnvFromSource]] = Field( - default=None, - alias="envFrom", - description=( - "List of sources to populate environment variables in the container. The" - " keys defined within a source must be a C_IDENTIFIER. All invalid keys" - " will be reported as an event when the container is starting. When a key" - " exists in multiple sources, the value associated with the last source" - " will take precedence. Values defined by an Env with a duplicate key will" - " take precedence. Cannot be updated." - ), - ) - image: Optional[str] = Field( - default=None, - description=( - "Container image name. More info:" - " https://kubernetes.io/docs/concepts/containers/images This field is" - " optional to allow higher level config management to default or override" - " container images in workload controllers like Deployments and" - " StatefulSets." - ), - ) - image_pull_policy: Optional[str] = Field( - default=None, - alias="imagePullPolicy", - description=( - "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always" - " if :latest tag is specified, or IfNotPresent otherwise. Cannot be" - " updated. More info:" - " https://kubernetes.io/docs/concepts/containers/images#updating-images" - ), - ) - lifecycle: Optional[v1.Lifecycle] = Field( - default=None, - description=( - "Actions that the management system should take in response to container" - " lifecycle events. Cannot be updated." - ), - ) - liveness_probe: Optional[v1.Probe] = Field( - default=None, - alias="livenessProbe", - description=( - "Periodic probe of container liveness. Container will be restarted if the" - " probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - mirror_volume_mounts: Optional[bool] = Field( - default=None, - alias="mirrorVolumeMounts", - description=( - "MirrorVolumeMounts will mount the same volumes specified in the main" - " container to the container (including artifacts), at the same mountPaths." - " This enables dind daemon to partially see the same filesystem as the main" - " container in order to use features such as docker volume binding" - ), - ) - name: str = Field( - ..., - description=( - "Name of the container specified as a DNS_LABEL. Each container in a pod" - " must have a unique name (DNS_LABEL). Cannot be updated." - ), - ) - ports: Optional[List[v1.ContainerPort]] = Field( - default=None, - description=( - "List of ports to expose from the container. Exposing a port here gives the" - " system additional information about the network connections a container" - " uses, but is primarily informational. Not specifying a port here DOES NOT" - " prevent that port from being exposed. Any port which is listening on the" - ' default "0.0.0.0" address inside a container will be accessible from the' - " network. Cannot be updated." - ), - ) - readiness_probe: Optional[v1.Probe] = Field( - default=None, - alias="readinessProbe", - description=( - "Periodic probe of container service readiness. Container will be removed" - " from service endpoints if the probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - resources: Optional[v1.ResourceRequirements] = Field( - default=None, - description=( - "Compute Resources required by this container. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - security_context: Optional[v1.SecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext defines the security options the container should be run" - " with. If set, the fields of SecurityContext override the equivalent" - " fields of PodSecurityContext. More info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" - ), - ) - startup_probe: Optional[v1.Probe] = Field( - default=None, - alias="startupProbe", - description=( - "StartupProbe indicates that the Pod has successfully initialized. If" - " specified, no other probes are executed until this completes" - " successfully. If this probe fails, the Pod will be restarted, just as if" - " the livenessProbe failed. This can be used to provide different probe" - " parameters at the beginning of a Pod's lifecycle, when it might take a" - " long time to load data or warm a cache, than during steady-state" - " operation. This cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - stdin: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a buffer for stdin in the container" - " runtime. If this is not set, reads from stdin in the container will" - " always result in EOF. Default is false." - ), - ) - stdin_once: Optional[bool] = Field( - default=None, - alias="stdinOnce", - description=( - "Whether the container runtime should close the stdin channel after it has" - " been opened by a single attach. When stdin is true the stdin stream will" - " remain open across multiple attach sessions. If stdinOnce is set to true," - " stdin is opened on container start, is empty until the first client" - " attaches to stdin, and then remains open and accepts data until the" - " client disconnects, at which time stdin is closed and remains closed" - " until the container is restarted. If this flag is false, a container" - " processes that reads from stdin will never receive an EOF. Default is" - " false" - ), - ) - termination_message_path: Optional[str] = Field( - default=None, - alias="terminationMessagePath", - description=( - "Optional: Path at which the file to which the container's termination" - " message will be written is mounted into the container's filesystem." - " Message written is intended to be brief final status, such as an" - " assertion failure message. Will be truncated by the node if greater than" - " 4096 bytes. The total message length across all containers will be" - " limited to 12kb. Defaults to /dev/termination-log. Cannot be updated." - ), - ) - termination_message_policy: Optional[str] = Field( - default=None, - alias="terminationMessagePolicy", - description=( - "Indicate how the termination message should be populated. File will use" - " the contents of terminationMessagePath to populate the container status" - " message on both success and failure. FallbackToLogsOnError will use the" - " last chunk of container log output if the termination message file is" - " empty and the container exited with an error. The log output is limited" - " to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot" - " be updated." - ), - ) - tty: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a TTY for itself, also requires" - " 'stdin' to be true. Default is false." - ), - ) - volume_devices: Optional[List[v1.VolumeDevice]] = Field( - default=None, - alias="volumeDevices", - description=("volumeDevices is the list of block devices to be used by the container."), - ) - volume_mounts: Optional[List[v1.VolumeMount]] = Field( - default=None, - alias="volumeMounts", - description=("Pod volumes to mount into the container's filesystem. Cannot be updated."), - ) - working_dir: Optional[str] = Field( - default=None, - alias="workingDir", - description=( - "Container's working directory. If not specified, the container runtime's" - " default will be used, which might be configured in the container image." - " Cannot be updated." - ), - ) +class InfoResponse(BaseModel): + links: Optional[List[Link]] = None + managed_namespace: Annotated[Optional[str], Field(alias="managedNamespace")] = None + modals: Annotated[Optional[Dict[str, bool]], Field(title="which modals to show")] = None + nav_color: Annotated[Optional[str], Field(alias="navColor")] = None -class Arguments(BaseModel): - artifacts: Optional[List[Artifact]] = Field( - default=None, - description=("Artifacts is the list of artifacts to pass to the template or workflow"), - ) - parameters: Optional[List[Parameter]] = Field( - default=None, - description=("Parameters is the list of parameters to pass to the template or workflow"), - ) +class Inputs(BaseModel): + artifacts: Annotated[ + Optional[List[Artifact]], + Field(description="Artifact are a list of artifacts passed as inputs"), + ] = None + parameters: Annotated[ + Optional[List[Parameter]], + Field(description="Parameters are a list of parameters passed as inputs"), + ] = None -class ArtifactGCSpec(BaseModel): - artifacts_by_node: Optional[Dict[str, ArtifactNodeSpec]] = Field( - default=None, - alias="artifactsByNode", - description=("ArtifactsByNode maps Node name to information pertaining to Artifacts on" " that Node"), - ) +class Metrics(BaseModel): + prometheus: Annotated[ + Optional[List[Prometheus]], + Field(description="Prometheus is a list of prometheus metrics to be emitted"), + ] = None -class Data(BaseModel): - source: DataSource = Field(..., description="Source sources external data into a data template") - transformation: List[TransformationStep] = Field( - ..., description="Transformation applies a set of transformations" - ) +class Outputs(BaseModel): + artifacts: Annotated[ + Optional[List[Artifact]], + Field(description=("Artifacts holds the list of output artifacts produced by a step")), + ] = None + exit_code: Annotated[ + Optional[str], + Field( + alias="exitCode", + description="ExitCode holds the exit code of a script template", + ), + ] = None + parameters: Annotated[ + Optional[List[Parameter]], + Field(description=("Parameters holds the list of output parameters produced by a step")), + ] = None + result: Annotated[ + Optional[str], + Field(description="Result holds the result (stdout) of a script template"), + ] = None class LifecycleHook(BaseModel): - arguments: Optional[Arguments] = Field(default=None, description="Arguments hold arguments to the template") - expression: Optional[str] = Field( - default=None, - description=( - "Expression is a condition expression for when a node will be retried. If" - " it evaluates to false, the node will not be retried and the retry" - " strategy will be ignored" - ), - ) - template: Optional[str] = Field( - default=None, - description="Template is the name of the template to execute by the hook", - ) - template_ref: Optional[TemplateRef] = Field( - default=None, - alias="templateRef", - description=("TemplateRef is the reference to the template resource to execute by the" " hook"), - ) + arguments: Annotated[ + Optional[Arguments], + Field(description="Arguments hold arguments to the template"), + ] = None + expression: Annotated[ + Optional[str], + Field( + description=( + "Expression is a condition expression for when a node will be retried." + " If it evaluates to false, the node will not be retried and the retry" + " strategy will be ignored" + ) + ), + ] = None + template: Annotated[ + Optional[str], + Field(description="Template is the name of the template to execute by the hook"), + ] = None + template_ref: Annotated[ + Optional[TemplateRef], + Field( + alias="templateRef", + description=("TemplateRef is the reference to the template resource to execute by" " the hook"), + ), + ] = None + + +class HTTP(BaseModel): + body: Annotated[Optional[str], Field(description="Body is content of the HTTP Request")] = None + body_from: Annotated[ + Optional[HTTPBodySource], + Field( + alias="bodyFrom", + description="BodyFrom is content of the HTTP Request as Bytes", + ), + ] = None + headers: Annotated[ + Optional[List[HTTPHeader]], + Field(description=("Headers are an optional list of headers to send with HTTP requests")), + ] = None + insecure_skip_verify: Annotated[ + Optional[bool], + Field( + alias="insecureSkipVerify", + description=( + "InsecureSkipVerify is a bool when if set to true will skip TLS" " verification for the HTTP client" + ), + ), + ] = None + method: Annotated[Optional[str], Field(description="Method is HTTP methods for HTTP Request")] = None + success_condition: Annotated[ + Optional[str], + Field( + alias="successCondition", + description=("SuccessCondition is an expression if evaluated to true is considered" " successful"), + ), + ] = None + timeout_seconds: Annotated[ + Optional[int], + Field( + alias="timeoutSeconds", + description=("TimeoutSeconds is request timeout for HTTP Request. Default is 30" " seconds"), + ), + ] = None + url: Annotated[str, Field(description="URL of the HTTP Request")] class NodeResult(BaseModel): @@ -2521,1284 +2314,2407 @@ class NodeResult(BaseModel): class NodeStatus(BaseModel): - boundary_id: Optional[str] = Field( - default=None, - alias="boundaryID", - description=( - "BoundaryID indicates the node ID of the associated template root node in" " which this node belongs to" - ), - ) - children: Optional[List[str]] = Field(default=None, description="Children is a list of child node IDs") - daemoned: Optional[bool] = Field( - default=None, - description=("Daemoned tracks whether or not this node was daemoned and need to be" " terminated"), - ) - display_name: Optional[str] = Field( - default=None, - alias="displayName", - description=( - "DisplayName is a human readable representation of the node. Unique within" " a template boundary" - ), - ) - estimated_duration: Optional[int] = Field( - default=None, - alias="estimatedDuration", - description="EstimatedDuration in seconds.", - ) - finished_at: Optional[v1_1.Time] = Field( - default=None, - alias="finishedAt", - description="Time at which this node completed", - ) - host_node_name: Optional[str] = Field( - default=None, - alias="hostNodeName", - description=("HostNodeName name of the Kubernetes node on which the Pod is running, if" " applicable"), - ) - id: str = Field( - ..., - description=( - "ID is a unique identifier of a node within the worklow It is implemented" - " as a hash of the node name, which makes the ID deterministic" - ), - ) - inputs: Optional[Inputs] = Field( - default=None, - description=( - "Inputs captures input parameter values and artifact locations supplied to" " this template invocation" - ), - ) - memoization_status: Optional[MemoizationStatus] = Field( - default=None, - alias="memoizationStatus", - description="MemoizationStatus holds information about cached nodes", - ) - message: Optional[str] = Field( - default=None, - description=("A human readable message indicating details about why the node is in this" " condition."), - ) - name: str = Field( - ..., - description="Name is unique name in the node tree used to generate the node ID", - ) - outbound_nodes: Optional[List[str]] = Field( - default=None, - alias="outboundNodes", - description=( - 'OutboundNodes tracks the node IDs which are considered "outbound" nodes to' - " a template invocation. For every invocation of a template, there are" - ' nodes which we considered as "outbound". Essentially, these are last' - " nodes in the execution sequence to run, before the template is considered" - " completed. These nodes are then connected as parents to a following" - " step.\n\nIn the case of single pod steps (i.e. container, script," - " resource templates), this list will be nil since the pod itself is" - ' already considered the "outbound" node. In the case of DAGs, outbound' - ' nodes are the "target" tasks (tasks with no children). In the case of' - " steps, outbound nodes are all the containers involved in the last step" - " group. NOTE: since templates are composable, the list of outbound nodes" - " are carried upwards when a DAG/steps template invokes another DAG/steps" - " template. In other words, the outbound nodes of a template, will be a" - " superset of the outbound nodes of its last children." - ), - ) - outputs: Optional[Outputs] = Field( - default=None, - description=( - "Outputs captures output parameter values and artifact locations produced" " by this template invocation" - ), - ) - phase: Optional[str] = Field( - default=None, - description=( - "Phase a simple, high-level summary of where the node is in its lifecycle." - " Can be used as a state machine." - ), - ) - pod_ip: Optional[str] = Field( - default=None, - alias="podIP", - description="PodIP captures the IP of the pod for daemoned steps", - ) - progress: Optional[str] = Field(default=None, description="Progress to completion") - resources_duration: Optional[Dict[str, int]] = Field( - default=None, - alias="resourcesDuration", - description=( - "ResourcesDuration is indicative, but not accurate, resource duration. This" - " is populated when the nodes completes." - ), - ) - started_at: Optional[v1_1.Time] = Field( - default=None, alias="startedAt", description="Time at which this node started" - ) - synchronization_status: Optional[NodeSynchronizationStatus] = Field( - default=None, - alias="synchronizationStatus", - description="SynchronizationStatus is the synchronization status of the node", - ) - template_name: Optional[str] = Field( - default=None, - alias="templateName", - description=( - "TemplateName is the template name which this node corresponds to. Not" - " applicable to virtual nodes (e.g. Retry, StepGroup)" - ), - ) - template_ref: Optional[TemplateRef] = Field( - default=None, - alias="templateRef", - description=( - "TemplateRef is the reference to the template resource which this node" - " corresponds to. Not applicable to virtual nodes (e.g. Retry, StepGroup)" - ), - ) - template_scope: Optional[str] = Field( - default=None, - alias="templateScope", - description=("TemplateScope is the template scope in which the template of this node was" " retrieved."), - ) - type: str = Field(..., description="Type indicates type of node") + boundary_id: Annotated[ + Optional[str], + Field( + alias="boundaryID", + description=( + "BoundaryID indicates the node ID of the associated template root node" + " in which this node belongs to" + ), + ), + ] = None + children: Annotated[Optional[List[str]], Field(description="Children is a list of child node IDs")] = None + daemoned: Annotated[ + Optional[bool], + Field(description=("Daemoned tracks whether or not this node was daemoned and need to be" " terminated")), + ] = None + display_name: Annotated[ + Optional[str], + Field( + alias="displayName", + description=( + "DisplayName is a human readable representation of the node. Unique" " within a template boundary" + ), + ), + ] = None + estimated_duration: Annotated[ + Optional[int], + Field(alias="estimatedDuration", description="EstimatedDuration in seconds."), + ] = None + finished_at: Annotated[ + Optional[v1_1.Time], + Field(alias="finishedAt", description="Time at which this node completed"), + ] = None + host_node_name: Annotated[ + Optional[str], + Field( + alias="hostNodeName", + description=("HostNodeName name of the Kubernetes node on which the Pod is running," " if applicable"), + ), + ] = None + id: Annotated[ + str, + Field( + description=( + "ID is a unique identifier of a node within the worklow It is" + " implemented as a hash of the node name, which makes the ID" + " deterministic" + ) + ), + ] + inputs: Annotated[ + Optional[Inputs], + Field( + description=( + "Inputs captures input parameter values and artifact locations supplied" " to this template invocation" + ) + ), + ] = None + memoization_status: Annotated[ + Optional[MemoizationStatus], + Field( + alias="memoizationStatus", + description="MemoizationStatus holds information about cached nodes", + ), + ] = None + message: Annotated[ + Optional[str], + Field(description=("A human readable message indicating details about why the node is in" " this condition.")), + ] = None + name: Annotated[ + str, + Field(description=("Name is unique name in the node tree used to generate the node ID")), + ] + outbound_nodes: Annotated[ + Optional[List[str]], + Field( + alias="outboundNodes", + description=( + 'OutboundNodes tracks the node IDs which are considered "outbound"' + " nodes to a template invocation. For every invocation of a template," + ' there are nodes which we considered as "outbound". Essentially, these' + " are last nodes in the execution sequence to run, before the template" + " is considered completed. These nodes are then connected as parents to" + " a following step.\n\nIn the case of single pod steps (i.e. container," + " script, resource templates), this list will be nil since the pod" + ' itself is already considered the "outbound" node. In the case of' + ' DAGs, outbound nodes are the "target" tasks (tasks with no children).' + " In the case of steps, outbound nodes are all the containers involved" + " in the last step group. NOTE: since templates are composable, the" + " list of outbound nodes are carried upwards when a DAG/steps template" + " invokes another DAG/steps template. In other words, the outbound" + " nodes of a template, will be a superset of the outbound nodes of its" + " last children." + ), + ), + ] = None + outputs: Annotated[ + Optional[Outputs], + Field( + description=( + "Outputs captures output parameter values and artifact locations" + " produced by this template invocation" + ) + ), + ] = None + phase: Annotated[ + Optional[str], + Field( + description=( + "Phase a simple, high-level summary of where the node is in its" + " lifecycle. Can be used as a state machine." + ) + ), + ] = None + pod_ip: Annotated[ + Optional[str], + Field( + alias="podIP", + description="PodIP captures the IP of the pod for daemoned steps", + ), + ] = None + progress: Annotated[Optional[str], Field(description="Progress to completion")] = None + resources_duration: Annotated[ + Optional[Dict[str, int]], + Field( + alias="resourcesDuration", + description=( + "ResourcesDuration is indicative, but not accurate, resource duration." + " This is populated when the nodes completes." + ), + ), + ] = None + started_at: Annotated[ + Optional[v1_1.Time], + Field(alias="startedAt", description="Time at which this node started"), + ] = None + synchronization_status: Annotated[ + Optional[NodeSynchronizationStatus], + Field( + alias="synchronizationStatus", + description=("SynchronizationStatus is the synchronization status of the node"), + ), + ] = None + template_name: Annotated[ + Optional[str], + Field( + alias="templateName", + description=( + "TemplateName is the template name which this node corresponds to. Not" + " applicable to virtual nodes (e.g. Retry, StepGroup)" + ), + ), + ] = None + template_ref: Annotated[ + Optional[TemplateRef], + Field( + alias="templateRef", + description=( + "TemplateRef is the reference to the template resource which this node" + " corresponds to. Not applicable to virtual nodes (e.g. Retry," + " StepGroup)" + ), + ), + ] = None + template_scope: Annotated[ + Optional[str], + Field( + alias="templateScope", + description=("TemplateScope is the template scope in which the template of this node" " was retrieved."), + ), + ] = None + type: Annotated[str, Field(description="Type indicates type of node")] -class Submit(BaseModel): - arguments: Optional[Arguments] = Field( - default=None, - description=("Arguments extracted from the event and then set as arguments to the" " workflow created."), - ) - metadata: Optional[v1_1.ObjectMeta] = Field( - default=None, - description=("Metadata optional means to customize select fields of the workflow" " metadata"), - ) - workflow_template_ref: WorkflowTemplateRef = Field( - ..., - alias="workflowTemplateRef", - description="WorkflowTemplateRef the workflow template to submit", - ) +class PodGC(BaseModel): + label_selector: Annotated[ + Optional[v1_1.LabelSelector], + Field( + alias="labelSelector", + description=( + "LabelSelector is the label selector to check if the pods match the" + " labels before being added to the pod GC queue." + ), + ), + ] = None + strategy: Annotated[ + Optional[str], + Field( + description=( + 'Strategy is the strategy to use. One of "OnPodCompletion",' + ' "OnPodSuccess", "OnWorkflowCompletion", "OnWorkflowSuccess"' + ) + ), + ] = None -class WorkflowEventBindingSpec(BaseModel): - event: Event = Field(..., description="Event is the event to bind to") - submit: Optional[Submit] = Field(default=None, description="Submit is the workflow template to submit") +class Submit(BaseModel): + arguments: Annotated[ + Optional[Arguments], + Field( + description=("Arguments extracted from the event and then set as arguments to the" " workflow created.") + ), + ] = None + metadata: Annotated[ + Optional[v1_1.ObjectMeta], + Field(description=("Metadata optional means to customize select fields of the workflow" " metadata")), + ] = None + workflow_template_ref: Annotated[ + WorkflowTemplateRef, + Field( + alias="workflowTemplateRef", + description="WorkflowTemplateRef the workflow template to submit", + ), + ] -class WorkflowTaskSetStatus(BaseModel): - nodes: Optional[Dict[str, NodeResult]] = None +class WorkflowEventBindingSpec(BaseModel): + event: Annotated[Event, Field(description="Event is the event to bind to")] + submit: Annotated[Optional[Submit], Field(description="Submit is the workflow template to submit")] = None class WorkflowEventBinding(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ObjectMeta spec: WorkflowEventBindingSpec -class WorkflowEventBindingList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[WorkflowEventBinding]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ListMeta +class ContainerNode(BaseModel): + args: Annotated[ + Optional[List[str]], + Field( + description=( + "Arguments to the entrypoint. The container image's CMD is used if" + " this is not provided. Variable references $(VAR_NAME) are expanded" + " using the container's environment. If a variable cannot be resolved," + " the reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + " of whether the variable exists or not. Cannot be updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Entrypoint array. Not executed within a shell. The container image's" + " ENTRYPOINT is used if this is not provided. Variable references" + " $(VAR_NAME) are expanded using the container's environment. If a" + " variable cannot be resolved, the reference in the input string will" + " be unchanged. Double $$ are reduced to a single $, which allows for" + ' escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the' + ' string literal "$(VAR_NAME)". Escaped references will never be' + " expanded, regardless of whether the variable exists or not. Cannot be" + " updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + dependencies: Optional[List[str]] = None + env: Annotated[ + Optional[List[v1.EnvVar]], + Field(description=("List of environment variables to set in the container. Cannot be" " updated.")), + ] = None + env_from: Annotated[ + Optional[List[v1.EnvFromSource]], + Field( + alias="envFrom", + description=( + "List of sources to populate environment variables in the container." + " The keys defined within a source must be a C_IDENTIFIER. All invalid" + " keys will be reported as an event when the container is starting." + " When a key exists in multiple sources, the value associated with the" + " last source will take precedence. Values defined by an Env with a" + " duplicate key will take precedence. Cannot be updated." + ), + ), + ] = None + image: Annotated[ + Optional[str], + Field( + description=( + "Container image name. More info:" + " https://kubernetes.io/docs/concepts/containers/images This field is" + " optional to allow higher level config management to default or" + " override container images in workload controllers like Deployments" + " and StatefulSets." + ) + ), + ] = None + image_pull_policy: Annotated[ + Optional[str], + Field( + alias="imagePullPolicy", + description=( + "Image pull policy. One of Always, Never, IfNotPresent. Defaults to" + " Always if :latest tag is specified, or IfNotPresent otherwise. Cannot" + " be updated. More info:" + " https://kubernetes.io/docs/concepts/containers/images#updating-images" + ), + ), + ] = None + lifecycle: Annotated[ + Optional[v1.Lifecycle], + Field( + description=( + "Actions that the management system should take in response to" + " container lifecycle events. Cannot be updated." + ) + ), + ] = None + liveness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="livenessProbe", + description=( + "Periodic probe of container liveness. Container will be restarted if" + " the probe fails. Cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + name: Annotated[ + str, + Field( + description=( + "Name of the container specified as a DNS_LABEL. Each container in a" + " pod must have a unique name (DNS_LABEL). Cannot be updated." + ) + ), + ] + ports: Annotated[ + Optional[List[v1.ContainerPort]], + Field( + description=( + "List of ports to expose from the container. Exposing a port here gives" + " the system additional information about the network connections a" + " container uses, but is primarily informational. Not specifying a port" + " here DOES NOT prevent that port from being exposed. Any port which is" + ' listening on the default "0.0.0.0" address inside a container will be' + " accessible from the network. Cannot be updated." + ) + ), + ] = None + readiness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="readinessProbe", + description=( + "Periodic probe of container service readiness. Container will be" + " removed from service endpoints if the probe fails. Cannot be updated." + " More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + resources: Annotated[ + Optional[v1.ResourceRequirements], + Field( + description=( + "Compute Resources required by this container. Cannot be updated. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + security_context: Annotated[ + Optional[v1.SecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext defines the security options the container should be" + " run with. If set, the fields of SecurityContext override the" + " equivalent fields of PodSecurityContext. More info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" + ), + ), + ] = None + startup_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="startupProbe", + description=( + "StartupProbe indicates that the Pod has successfully initialized. If" + " specified, no other probes are executed until this completes" + " successfully. If this probe fails, the Pod will be restarted, just as" + " if the livenessProbe failed. This can be used to provide different" + " probe parameters at the beginning of a Pod's lifecycle, when it might" + " take a long time to load data or warm a cache, than during" + " steady-state operation. This cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + stdin: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a buffer for stdin in the" + " container runtime. If this is not set, reads from stdin in the" + " container will always result in EOF. Default is false." + ) + ), + ] = None + stdin_once: Annotated[ + Optional[bool], + Field( + alias="stdinOnce", + description=( + "Whether the container runtime should close the stdin channel after it" + " has been opened by a single attach. When stdin is true the stdin" + " stream will remain open across multiple attach sessions. If stdinOnce" + " is set to true, stdin is opened on container start, is empty until" + " the first client attaches to stdin, and then remains open and accepts" + " data until the client disconnects, at which time stdin is closed and" + " remains closed until the container is restarted. If this flag is" + " false, a container processes that reads from stdin will never receive" + " an EOF. Default is false" + ), + ), + ] = None + termination_message_path: Annotated[ + Optional[str], + Field( + alias="terminationMessagePath", + description=( + "Optional: Path at which the file to which the container's termination" + " message will be written is mounted into the container's filesystem." + " Message written is intended to be brief final status, such as an" + " assertion failure message. Will be truncated by the node if greater" + " than 4096 bytes. The total message length across all containers will" + " be limited to 12kb. Defaults to /dev/termination-log. Cannot be" + " updated." + ), + ), + ] = None + termination_message_policy: Annotated[ + Optional[str], + Field( + alias="terminationMessagePolicy", + description=( + "Indicate how the termination message should be populated. File will" + " use the contents of terminationMessagePath to populate the container" + " status message on both success and failure. FallbackToLogsOnError" + " will use the last chunk of container log output if the termination" + " message file is empty and the container exited with an error. The log" + " output is limited to 2048 bytes or 80 lines, whichever is smaller." + " Defaults to File. Cannot be updated." + ), + ), + ] = None + tty: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a TTY for itself, also requires" + " 'stdin' to be true. Default is false." + ) + ), + ] = None + volume_devices: Annotated[ + Optional[List[v1.VolumeDevice]], + Field( + alias="volumeDevices", + description=("volumeDevices is the list of block devices to be used by the" " container."), + ), + ] = None + volume_mounts: Annotated[ + Optional[List[v1.VolumeMount]], + Field( + alias="volumeMounts", + description=("Pod volumes to mount into the container's filesystem. Cannot be" " updated."), + ), + ] = None + working_dir: Annotated[ + Optional[str], + Field( + alias="workingDir", + description=( + "Container's working directory. If not specified, the container" + " runtime's default will be used, which might be configured in the" + " container image. Cannot be updated." + ), + ), + ] = None -class ClusterWorkflowTemplate(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ObjectMeta - spec: WorkflowSpec +class ScriptTemplate(BaseModel): + args: Annotated[ + Optional[List[str]], + Field( + description=( + "Arguments to the entrypoint. The container image's CMD is used if" + " this is not provided. Variable references $(VAR_NAME) are expanded" + " using the container's environment. If a variable cannot be resolved," + " the reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + " of whether the variable exists or not. Cannot be updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Entrypoint array. Not executed within a shell. The container image's" + " ENTRYPOINT is used if this is not provided. Variable references" + " $(VAR_NAME) are expanded using the container's environment. If a" + " variable cannot be resolved, the reference in the input string will" + " be unchanged. Double $$ are reduced to a single $, which allows for" + ' escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the' + ' string literal "$(VAR_NAME)". Escaped references will never be' + " expanded, regardless of whether the variable exists or not. Cannot be" + " updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + env: Annotated[ + Optional[List[v1.EnvVar]], + Field(description=("List of environment variables to set in the container. Cannot be" " updated.")), + ] = None + env_from: Annotated[ + Optional[List[v1.EnvFromSource]], + Field( + alias="envFrom", + description=( + "List of sources to populate environment variables in the container." + " The keys defined within a source must be a C_IDENTIFIER. All invalid" + " keys will be reported as an event when the container is starting." + " When a key exists in multiple sources, the value associated with the" + " last source will take precedence. Values defined by an Env with a" + " duplicate key will take precedence. Cannot be updated." + ), + ), + ] = None + image: Annotated[ + str, + Field( + description=( + "Container image name. More info:" + " https://kubernetes.io/docs/concepts/containers/images This field is" + " optional to allow higher level config management to default or" + " override container images in workload controllers like Deployments" + " and StatefulSets." + ) + ), + ] + image_pull_policy: Annotated[ + Optional[str], + Field( + alias="imagePullPolicy", + description=( + "Image pull policy. One of Always, Never, IfNotPresent. Defaults to" + " Always if :latest tag is specified, or IfNotPresent otherwise. Cannot" + " be updated. More info:" + " https://kubernetes.io/docs/concepts/containers/images#updating-images" + ), + ), + ] = None + lifecycle: Annotated[ + Optional[v1.Lifecycle], + Field( + description=( + "Actions that the management system should take in response to" + " container lifecycle events. Cannot be updated." + ) + ), + ] = None + liveness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="livenessProbe", + description=( + "Periodic probe of container liveness. Container will be restarted if" + " the probe fails. Cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the container specified as a DNS_LABEL. Each container in a" + " pod must have a unique name (DNS_LABEL). Cannot be updated." + ) + ), + ] = None + ports: Annotated[ + Optional[List[v1.ContainerPort]], + Field( + description=( + "List of ports to expose from the container. Exposing a port here gives" + " the system additional information about the network connections a" + " container uses, but is primarily informational. Not specifying a port" + " here DOES NOT prevent that port from being exposed. Any port which is" + ' listening on the default "0.0.0.0" address inside a container will be' + " accessible from the network. Cannot be updated." + ) + ), + ] = None + readiness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="readinessProbe", + description=( + "Periodic probe of container service readiness. Container will be" + " removed from service endpoints if the probe fails. Cannot be updated." + " More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + resources: Annotated[ + Optional[v1.ResourceRequirements], + Field( + description=( + "Compute Resources required by this container. Cannot be updated. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + security_context: Annotated[ + Optional[v1.SecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext defines the security options the container should be" + " run with. If set, the fields of SecurityContext override the" + " equivalent fields of PodSecurityContext. More info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" + ), + ), + ] = None + source: Annotated[ + str, + Field(description="Source contains the source code of the script to execute"), + ] + startup_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="startupProbe", + description=( + "StartupProbe indicates that the Pod has successfully initialized. If" + " specified, no other probes are executed until this completes" + " successfully. If this probe fails, the Pod will be restarted, just as" + " if the livenessProbe failed. This can be used to provide different" + " probe parameters at the beginning of a Pod's lifecycle, when it might" + " take a long time to load data or warm a cache, than during" + " steady-state operation. This cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + stdin: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a buffer for stdin in the" + " container runtime. If this is not set, reads from stdin in the" + " container will always result in EOF. Default is false." + ) + ), + ] = None + stdin_once: Annotated[ + Optional[bool], + Field( + alias="stdinOnce", + description=( + "Whether the container runtime should close the stdin channel after it" + " has been opened by a single attach. When stdin is true the stdin" + " stream will remain open across multiple attach sessions. If stdinOnce" + " is set to true, stdin is opened on container start, is empty until" + " the first client attaches to stdin, and then remains open and accepts" + " data until the client disconnects, at which time stdin is closed and" + " remains closed until the container is restarted. If this flag is" + " false, a container processes that reads from stdin will never receive" + " an EOF. Default is false" + ), + ), + ] = None + termination_message_path: Annotated[ + Optional[str], + Field( + alias="terminationMessagePath", + description=( + "Optional: Path at which the file to which the container's termination" + " message will be written is mounted into the container's filesystem." + " Message written is intended to be brief final status, such as an" + " assertion failure message. Will be truncated by the node if greater" + " than 4096 bytes. The total message length across all containers will" + " be limited to 12kb. Defaults to /dev/termination-log. Cannot be" + " updated." + ), + ), + ] = None + termination_message_policy: Annotated[ + Optional[str], + Field( + alias="terminationMessagePolicy", + description=( + "Indicate how the termination message should be populated. File will" + " use the contents of terminationMessagePath to populate the container" + " status message on both success and failure. FallbackToLogsOnError" + " will use the last chunk of container log output if the termination" + " message file is empty and the container exited with an error. The log" + " output is limited to 2048 bytes or 80 lines, whichever is smaller." + " Defaults to File. Cannot be updated." + ), + ), + ] = None + tty: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a TTY for itself, also requires" + " 'stdin' to be true. Default is false." + ) + ), + ] = None + volume_devices: Annotated[ + Optional[List[v1.VolumeDevice]], + Field( + alias="volumeDevices", + description=("volumeDevices is the list of block devices to be used by the" " container."), + ), + ] = None + volume_mounts: Annotated[ + Optional[List[v1.VolumeMount]], + Field( + alias="volumeMounts", + description=("Pod volumes to mount into the container's filesystem. Cannot be" " updated."), + ), + ] = None + working_dir: Annotated[ + Optional[str], + Field( + alias="workingDir", + description=( + "Container's working directory. If not specified, the container" + " runtime's default will be used, which might be configured in the" + " container image. Cannot be updated." + ), + ), + ] = None -class ClusterWorkflowTemplateCreateRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") - template: Optional[ClusterWorkflowTemplate] = None +class UserContainer(BaseModel): + args: Annotated[ + Optional[List[str]], + Field( + description=( + "Arguments to the entrypoint. The container image's CMD is used if" + " this is not provided. Variable references $(VAR_NAME) are expanded" + " using the container's environment. If a variable cannot be resolved," + " the reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + " of whether the variable exists or not. Cannot be updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Entrypoint array. Not executed within a shell. The container image's" + " ENTRYPOINT is used if this is not provided. Variable references" + " $(VAR_NAME) are expanded using the container's environment. If a" + " variable cannot be resolved, the reference in the input string will" + " be unchanged. Double $$ are reduced to a single $, which allows for" + ' escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the' + ' string literal "$(VAR_NAME)". Escaped references will never be' + " expanded, regardless of whether the variable exists or not. Cannot be" + " updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + env: Annotated[ + Optional[List[v1.EnvVar]], + Field(description=("List of environment variables to set in the container. Cannot be" " updated.")), + ] = None + env_from: Annotated[ + Optional[List[v1.EnvFromSource]], + Field( + alias="envFrom", + description=( + "List of sources to populate environment variables in the container." + " The keys defined within a source must be a C_IDENTIFIER. All invalid" + " keys will be reported as an event when the container is starting." + " When a key exists in multiple sources, the value associated with the" + " last source will take precedence. Values defined by an Env with a" + " duplicate key will take precedence. Cannot be updated." + ), + ), + ] = None + image: Annotated[ + Optional[str], + Field( + description=( + "Container image name. More info:" + " https://kubernetes.io/docs/concepts/containers/images This field is" + " optional to allow higher level config management to default or" + " override container images in workload controllers like Deployments" + " and StatefulSets." + ) + ), + ] = None + image_pull_policy: Annotated[ + Optional[str], + Field( + alias="imagePullPolicy", + description=( + "Image pull policy. One of Always, Never, IfNotPresent. Defaults to" + " Always if :latest tag is specified, or IfNotPresent otherwise. Cannot" + " be updated. More info:" + " https://kubernetes.io/docs/concepts/containers/images#updating-images" + ), + ), + ] = None + lifecycle: Annotated[ + Optional[v1.Lifecycle], + Field( + description=( + "Actions that the management system should take in response to" + " container lifecycle events. Cannot be updated." + ) + ), + ] = None + liveness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="livenessProbe", + description=( + "Periodic probe of container liveness. Container will be restarted if" + " the probe fails. Cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + mirror_volume_mounts: Annotated[ + Optional[bool], + Field( + alias="mirrorVolumeMounts", + description=( + "MirrorVolumeMounts will mount the same volumes specified in the main" + " container to the container (including artifacts), at the same" + " mountPaths. This enables dind daemon to partially see the same" + " filesystem as the main container in order to use features such as" + " docker volume binding" + ), + ), + ] = None + name: Annotated[ + str, + Field( + description=( + "Name of the container specified as a DNS_LABEL. Each container in a" + " pod must have a unique name (DNS_LABEL). Cannot be updated." + ) + ), + ] + ports: Annotated[ + Optional[List[v1.ContainerPort]], + Field( + description=( + "List of ports to expose from the container. Exposing a port here gives" + " the system additional information about the network connections a" + " container uses, but is primarily informational. Not specifying a port" + " here DOES NOT prevent that port from being exposed. Any port which is" + ' listening on the default "0.0.0.0" address inside a container will be' + " accessible from the network. Cannot be updated." + ) + ), + ] = None + readiness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="readinessProbe", + description=( + "Periodic probe of container service readiness. Container will be" + " removed from service endpoints if the probe fails. Cannot be updated." + " More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + resources: Annotated[ + Optional[v1.ResourceRequirements], + Field( + description=( + "Compute Resources required by this container. Cannot be updated. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + security_context: Annotated[ + Optional[v1.SecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext defines the security options the container should be" + " run with. If set, the fields of SecurityContext override the" + " equivalent fields of PodSecurityContext. More info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" + ), + ), + ] = None + startup_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="startupProbe", + description=( + "StartupProbe indicates that the Pod has successfully initialized. If" + " specified, no other probes are executed until this completes" + " successfully. If this probe fails, the Pod will be restarted, just as" + " if the livenessProbe failed. This can be used to provide different" + " probe parameters at the beginning of a Pod's lifecycle, when it might" + " take a long time to load data or warm a cache, than during" + " steady-state operation. This cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + stdin: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a buffer for stdin in the" + " container runtime. If this is not set, reads from stdin in the" + " container will always result in EOF. Default is false." + ) + ), + ] = None + stdin_once: Annotated[ + Optional[bool], + Field( + alias="stdinOnce", + description=( + "Whether the container runtime should close the stdin channel after it" + " has been opened by a single attach. When stdin is true the stdin" + " stream will remain open across multiple attach sessions. If stdinOnce" + " is set to true, stdin is opened on container start, is empty until" + " the first client attaches to stdin, and then remains open and accepts" + " data until the client disconnects, at which time stdin is closed and" + " remains closed until the container is restarted. If this flag is" + " false, a container processes that reads from stdin will never receive" + " an EOF. Default is false" + ), + ), + ] = None + termination_message_path: Annotated[ + Optional[str], + Field( + alias="terminationMessagePath", + description=( + "Optional: Path at which the file to which the container's termination" + " message will be written is mounted into the container's filesystem." + " Message written is intended to be brief final status, such as an" + " assertion failure message. Will be truncated by the node if greater" + " than 4096 bytes. The total message length across all containers will" + " be limited to 12kb. Defaults to /dev/termination-log. Cannot be" + " updated." + ), + ), + ] = None + termination_message_policy: Annotated[ + Optional[str], + Field( + alias="terminationMessagePolicy", + description=( + "Indicate how the termination message should be populated. File will" + " use the contents of terminationMessagePath to populate the container" + " status message on both success and failure. FallbackToLogsOnError" + " will use the last chunk of container log output if the termination" + " message file is empty and the container exited with an error. The log" + " output is limited to 2048 bytes or 80 lines, whichever is smaller." + " Defaults to File. Cannot be updated." + ), + ), + ] = None + tty: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a TTY for itself, also requires" + " 'stdin' to be true. Default is false." + ) + ), + ] = None + volume_devices: Annotated[ + Optional[List[v1.VolumeDevice]], + Field( + alias="volumeDevices", + description=("volumeDevices is the list of block devices to be used by the" " container."), + ), + ] = None + volume_mounts: Annotated[ + Optional[List[v1.VolumeMount]], + Field( + alias="volumeMounts", + description=("Pod volumes to mount into the container's filesystem. Cannot be" " updated."), + ), + ] = None + working_dir: Annotated[ + Optional[str], + Field( + alias="workingDir", + description=( + "Container's working directory. If not specified, the container" + " runtime's default will be used, which might be configured in the" + " container image. Cannot be updated." + ), + ), + ] = None -class ClusterWorkflowTemplateLintRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") - template: Optional[ClusterWorkflowTemplate] = None +class WorkflowTaskSetStatus(BaseModel): + nodes: Optional[Dict[str, NodeResult]] = None -class ClusterWorkflowTemplateList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[ClusterWorkflowTemplate]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) +class WorkflowEventBindingList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[WorkflowEventBinding]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ListMeta -class ClusterWorkflowTemplateUpdateRequest(BaseModel): - name: Optional[str] = Field(default=None, description="DEPRECATED: This field is ignored.") - template: Optional[ClusterWorkflowTemplate] = None +class ContainerSetTemplate(BaseModel): + containers: List[ContainerNode] + retry_strategy: Annotated[ + Optional[ContainerSetRetryStrategy], + Field( + alias="retryStrategy", + description=( + "RetryStrategy describes how to retry a container nodes in the" + " container set if it fails. Nbr of retries(default 0) and sleep" + " duration between retries(default 0s, instant retry) can be set." + ), + ), + ] = None + volume_mounts: Annotated[Optional[List[v1.VolumeMount]], Field(alias="volumeMounts")] = None -class CreateCronWorkflowRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") - cron_workflow: Optional[CronWorkflow] = Field(default=None, alias="cronWorkflow") - namespace: Optional[str] = None +class DAGTemplate(BaseModel): + fail_fast: Annotated[ + Optional[bool], + Field( + alias="failFast", + description=( + 'This flag is for DAG logic. The DAG logic has a built-in "fail fast"' + " feature to stop scheduling new steps, as soon as it detects that one" + " of the DAG nodes is failed. Then it waits until all DAG nodes are" + " completed before failing the DAG itself. The FailFast flag default is" + " true, if set to false, it will allow a DAG to run all branches of" + " the DAG to completion (either success or failure), regardless of the" + " failed outcomes of branches in the DAG. More info and example about" + " this feature at" + " https://github.com/argoproj/argo-workflows/issues/1442" + ), + ), + ] = None + target: Annotated[ + Optional[str], + Field(description="Target are one or more names of targets to execute in a DAG"), + ] = None + tasks: Annotated[List[DAGTask], Field(description="Tasks are a list of DAG tasks")] -class CronWorkflow(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ObjectMeta - spec: CronWorkflowSpec - status: Optional[CronWorkflowStatus] = None +class ParallelSteps(BaseModel): + __root__: List[WorkflowStep] -class CronWorkflowList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[CronWorkflow]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) +class WorkflowTaskSetSpec(BaseModel): + tasks: Optional[Dict[str, Template]] = None + + +class ClusterWorkflowTemplateList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[ClusterWorkflowTemplate]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ListMeta -class CronWorkflowSpec(BaseModel): - concurrency_policy: Optional[str] = Field( - default=None, - alias="concurrencyPolicy", - description=("ConcurrencyPolicy is the K8s-style concurrency policy that will be used"), - ) - failed_jobs_history_limit: Optional[int] = Field( - default=None, - alias="failedJobsHistoryLimit", - description=("FailedJobsHistoryLimit is the number of failed jobs to be kept at a time"), - ) - schedule: str = Field(..., description="Schedule is a schedule to run the Workflow in Cron format") - starting_deadline_seconds: Optional[int] = Field( - default=None, - alias="startingDeadlineSeconds", - description=( - "StartingDeadlineSeconds is the K8s-style deadline that will limit the time" - " a CronWorkflow will be run after its original scheduled time if it is" - " missed." - ), - ) - successful_jobs_history_limit: Optional[int] = Field( - default=None, - alias="successfulJobsHistoryLimit", - description=("SuccessfulJobsHistoryLimit is the number of successful jobs to be kept at" " a time"), - ) - suspend: Optional[bool] = Field( - default=None, - description=("Suspend is a flag that will stop new CronWorkflows from running if set to" " true"), - ) - timezone: Optional[str] = Field( - default=None, - description=( - "Timezone is the timezone against which the cron schedule will be" - ' calculated, e.g. "Asia/Tokyo". Default is machine\'s local time.' - ), - ) - workflow_metadata: Optional[v1_1.ObjectMeta] = Field( - default=None, - alias="workflowMetadata", - description="WorkflowMetadata contains some metadata of the workflow to be run", - ) - workflow_spec: WorkflowSpec = Field( - ..., - alias="workflowSpec", - description="WorkflowSpec is the spec of the workflow to be run", - ) +class CronWorkflowList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[CronWorkflow]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ListMeta -class DAGTask(BaseModel): - arguments: Optional[Arguments] = Field( - default=None, - description=("Arguments are the parameter and artifact arguments to the template"), - ) - continue_on: Optional[ContinueOn] = Field( - default=None, - alias="continueOn", - description=( - "ContinueOn makes argo to proceed with the following step even if this step" - " fails. Errors and Failed states can be specified" - ), - ) - dependencies: Optional[List[str]] = Field( - default=None, - description="Dependencies are name of other targets which this depends on", - ) - depends: Optional[str] = Field( - default=None, - description="Depends are name of other targets which this depends on", - ) - hooks: Optional[Dict[str, LifecycleHook]] = Field( - default=None, - description=( - "Hooks hold the lifecycle hook which is invoked at lifecycle of task," - " irrespective of the success, failure, or error status of the primary task" - ), - ) - inline: Optional[Template] = Field( - default=None, - description=("Inline is the template. Template must be empty if this is declared (and" " vice-versa)."), - ) - name: str = Field(..., description="Name is the name of the target") - on_exit: Optional[str] = Field( - default=None, - alias="onExit", - description=( - "OnExit is a template reference which is invoked at the end of the" - " template, irrespective of the success, failure, or error of the primary" - " template. DEPRECATED: Use Hooks[exit].Template instead." - ), - ) - template: Optional[str] = Field(default=None, description="Name of template to execute") - template_ref: Optional[TemplateRef] = Field( - default=None, - alias="templateRef", - description="TemplateRef is the reference to the template resource to execute.", - ) - when: Optional[str] = Field( - default=None, - description=("When is an expression in which the task should conditionally execute"), - ) - with_items: Optional[List[Item]] = Field( - default=None, - alias="withItems", - description=("WithItems expands a task into multiple parallel tasks from the items in" " the list"), - ) - with_param: Optional[str] = Field( - default=None, - alias="withParam", - description=( - "WithParam expands a task into multiple parallel tasks from the value in" - " the parameter, which is expected to be a JSON list." - ), - ) - with_sequence: Optional[Sequence] = Field( - default=None, - alias="withSequence", - description="WithSequence expands a task into a numeric sequence", - ) +class WorkflowList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[Workflow]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ListMeta -class DAGTemplate(BaseModel): - fail_fast: Optional[bool] = Field( - default=None, - alias="failFast", - description=( - 'This flag is for DAG logic. The DAG logic has a built-in "fail fast"' - " feature to stop scheduling new steps, as soon as it detects that one of" - " the DAG nodes is failed. Then it waits until all DAG nodes are completed" - " before failing the DAG itself. The FailFast flag default is true, if set" - " to false, it will allow a DAG to run all branches of the DAG to" - " completion (either success or failure), regardless of the failed outcomes" - " of branches in the DAG. More info and example about this feature at" - " https://github.com/argoproj/argo-workflows/issues/1442" - ), - ) - target: Optional[str] = Field( - default=None, - description="Target are one or more names of targets to execute in a DAG", - ) - tasks: List[DAGTask] = Field(..., description="Tasks are a list of DAG tasks") +class WorkflowTemplateList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[WorkflowTemplate]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ListMeta -class LintCronWorkflowRequest(BaseModel): - cron_workflow: Optional[CronWorkflow] = Field(default=None, alias="cronWorkflow") - namespace: Optional[str] = None +class Template(BaseModel): + active_deadline_seconds: Annotated[ + Optional[intstr.IntOrString], + Field( + alias="activeDeadlineSeconds", + description=( + "Optional duration in seconds relative to the StartTime that the pod" + " may be active on a node before the system actively tries to terminate" + " the pod; value must be positive integer This field is only applicable" + " to container and script templates." + ), + ), + ] = None + affinity: Annotated[ + Optional[v1.Affinity], + Field( + description=( + "Affinity sets the pod's scheduling constraints Overrides the affinity" + " set at the workflow level (if any)" + ) + ), + ] = None + archive_location: Annotated[ + Optional[ArtifactLocation], + Field( + alias="archiveLocation", + description=( + "Location in which all files related to the step will be stored (logs," + " artifacts, etc...). Can be overridden by individual items in Outputs." + " If omitted, will use the default artifact repository location" + " configured in the controller, appended with the" + " / in the key." + ), + ), + ] = None + automount_service_account_token: Annotated[ + Optional[bool], + Field( + alias="automountServiceAccountToken", + description=( + "AutomountServiceAccountToken indicates whether a service account token" + " should be automatically mounted in pods. ServiceAccountName of" + " ExecutorConfig must be specified if this value is false." + ), + ), + ] = None + container: Annotated[ + Optional[v1.Container], + Field(description="Container is the main container image to run in the pod"), + ] = None + container_set: Annotated[ + Optional[ContainerSetTemplate], + Field( + alias="containerSet", + description="ContainerSet groups multiple containers within a single pod.", + ), + ] = None + daemon: Annotated[ + Optional[bool], + Field( + description=( + "Deamon will allow a workflow to proceed to the next step so long as" + " the container reaches readiness" + ) + ), + ] = None + dag: Annotated[ + Optional[DAGTemplate], + Field(description="DAG template subtype which runs a DAG"), + ] = None + data: Annotated[Optional[Data], Field(description="Data is a data template")] = None + executor: Annotated[ + Optional[ExecutorConfig], + Field(description="Executor holds configurations of the executor container."), + ] = None + fail_fast: Annotated[ + Optional[bool], + Field( + alias="failFast", + description=( + "FailFast, if specified, will fail this template if any of its child" + " pods has failed. This is useful for when this template is expanded" + " with `withItems`, etc." + ), + ), + ] = None + host_aliases: Annotated[ + Optional[List[v1.HostAlias]], + Field( + alias="hostAliases", + description=( + "HostAliases is an optional list of hosts and IPs that will be injected" " into the pod spec" + ), + ), + ] = None + http: Annotated[Optional[HTTP], Field(description="HTTP makes a HTTP request")] = None + init_containers: Annotated[ + Optional[List[UserContainer]], + Field( + alias="initContainers", + description=("InitContainers is a list of containers which run before the main" " container."), + ), + ] = None + inputs: Annotated[ + Optional[Inputs], + Field(description=("Inputs describe what inputs parameters and artifacts are supplied to" " this template")), + ] = None + memoize: Annotated[ + Optional[Memoize], + Field(description=("Memoize allows templates to use outputs generated from already" " executed templates")), + ] = None + metadata: Annotated[ + Optional[Metadata], + Field(description="Metdata sets the pods's metadata, i.e. annotations and labels"), + ] = None + metrics: Annotated[ + Optional[Metrics], + Field(description="Metrics are a list of metrics emitted from this template"), + ] = None + name: Annotated[Optional[str], Field(description="Name is the name of the template")] = None + node_selector: Annotated[ + Optional[Dict[str, str]], + Field( + alias="nodeSelector", + description=( + "NodeSelector is a selector to schedule this step of the workflow to be" + " run on the selected node(s). Overrides the selector set at the" + " workflow level." + ), + ), + ] = None + outputs: Annotated[ + Optional[Outputs], + Field(description=("Outputs describe the parameters and artifacts that this template" " produces")), + ] = None + parallelism: Annotated[ + Optional[int], + Field( + description=( + "Parallelism limits the max total parallel pods that can execute at the" + " same time within the boundaries of this template invocation. If" + " additional steps/dag templates are invoked, the pods created by those" + " templates will not be counted towards this total." + ) + ), + ] = None + plugin: Annotated[Optional[Plugin], Field(description="Plugin is a plugin template")] = None + pod_spec_patch: Annotated[ + Optional[str], + Field( + alias="podSpecPatch", + description=( + "PodSpecPatch holds strategic merge patch to apply against the pod" + " spec. Allows parameterization of container fields which are not" + " strings (e.g. resource limits)." + ), + ), + ] = None + priority: Annotated[Optional[int], Field(description="Priority to apply to workflow pods.")] = None + priority_class_name: Annotated[ + Optional[str], + Field( + alias="priorityClassName", + description="PriorityClassName to apply to workflow pods.", + ), + ] = None + resource: Annotated[ + Optional[ResourceTemplate], + Field(description="Resource template subtype which can run k8s resources"), + ] = None + retry_strategy: Annotated[ + Optional[RetryStrategy], + Field( + alias="retryStrategy", + description="RetryStrategy describes how to retry a template when it fails", + ), + ] = None + scheduler_name: Annotated[ + Optional[str], + Field( + alias="schedulerName", + description=( + "If specified, the pod will be dispatched by specified scheduler. Or it" + " will be dispatched by workflow scope scheduler if specified. If" + " neither specified, the pod will be dispatched by default scheduler." + ), + ), + ] = None + script: Annotated[ + Optional[ScriptTemplate], + Field(description="Script runs a portion of code against an interpreter"), + ] = None + security_context: Annotated[ + Optional[v1.PodSecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext holds pod-level security attributes and common" + " container settings. Optional: Defaults to empty. See type" + " description for default values of each field." + ), + ), + ] = None + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + description="ServiceAccountName to apply to workflow pods", + ), + ] = None + sidecars: Annotated[ + Optional[List[UserContainer]], + Field( + description=( + "Sidecars is a list of containers which run alongside the main" + " container Sidecars are automatically killed when the main container" + " completes" + ) + ), + ] = None + steps: Annotated[ + Optional[List[ParallelSteps]], + Field(description="Steps define a series of sequential/parallel workflow steps"), + ] = None + suspend: Annotated[ + Optional[SuspendTemplate], + Field(description=("Suspend template subtype which can suspend a workflow when reaching" " the step")), + ] = None + synchronization: Annotated[ + Optional[Synchronization], + Field(description=("Synchronization holds synchronization lock configuration for this" " template")), + ] = None + timeout: Annotated[ + Optional[str], + Field( + description=( + "Timeout allows to set the total node execution timeout duration" + " counting from the node's start time. This duration also includes time" + " in which the node spends in Pending state. This duration may not be" + " applied to Step or DAG templates." + ) + ), + ] = None + tolerations: Annotated[ + Optional[List[v1.Toleration]], + Field(description="Tolerations to apply to workflow pods."), + ] = None + volumes: Annotated[ + Optional[List[v1.Volume]], + Field(description=("Volumes is a list of volumes that can be mounted by containers in a" " template.")), + ] = None -class ParallelSteps(BaseModel): - __root__: List[WorkflowStep] +class DAGTask(BaseModel): + arguments: Annotated[ + Optional[Arguments], + Field(description=("Arguments are the parameter and artifact arguments to the template")), + ] = None + continue_on: Annotated[ + Optional[ContinueOn], + Field( + alias="continueOn", + description=( + "ContinueOn makes argo to proceed with the following step even if this" + " step fails. Errors and Failed states can be specified" + ), + ), + ] = None + dependencies: Annotated[ + Optional[List[str]], + Field(description="Dependencies are name of other targets which this depends on"), + ] = None + depends: Annotated[ + Optional[str], + Field(description="Depends are name of other targets which this depends on"), + ] = None + hooks: Annotated[ + Optional[Dict[str, LifecycleHook]], + Field( + description=( + "Hooks hold the lifecycle hook which is invoked at lifecycle of task," + " irrespective of the success, failure, or error status of the primary" + " task" + ) + ), + ] = None + inline: Annotated[ + Optional[Template], + Field(description=("Inline is the template. Template must be empty if this is declared" " (and vice-versa).")), + ] = None + name: Annotated[str, Field(description="Name is the name of the target")] + on_exit: Annotated[ + Optional[str], + Field( + alias="onExit", + description=( + "OnExit is a template reference which is invoked at the end of the" + " template, irrespective of the success, failure, or error of the" + " primary template. DEPRECATED: Use Hooks[exit].Template instead." + ), + ), + ] = None + template: Annotated[Optional[str], Field(description="Name of template to execute")] = None + template_ref: Annotated[ + Optional[TemplateRef], + Field( + alias="templateRef", + description=("TemplateRef is the reference to the template resource to execute."), + ), + ] = None + when: Annotated[ + Optional[str], + Field(description=("When is an expression in which the task should conditionally execute")), + ] = None + with_items: Annotated[ + Optional[List[Item]], + Field( + alias="withItems", + description=("WithItems expands a task into multiple parallel tasks from the items" " in the list"), + ), + ] = None + with_param: Annotated[ + Optional[str], + Field( + alias="withParam", + description=( + "WithParam expands a task into multiple parallel tasks from the value" + " in the parameter, which is expected to be a JSON list." + ), + ), + ] = None + with_sequence: Annotated[ + Optional[Sequence], + Field( + alias="withSequence", + description="WithSequence expands a task into a numeric sequence", + ), + ] = None -class Template(BaseModel): - active_deadline_seconds: Optional[intstr.IntOrString] = Field( - default=None, - alias="activeDeadlineSeconds", - description=( - "Optional duration in seconds relative to the StartTime that the pod may be" - " active on a node before the system actively tries to terminate the pod;" - " value must be positive integer This field is only applicable to container" - " and script templates." - ), - ) - affinity: Optional[v1.Affinity] = Field( - default=None, - description=( - "Affinity sets the pod's scheduling constraints Overrides the affinity set" - " at the workflow level (if any)" - ), - ) - archive_location: Optional[ArtifactLocation] = Field( - default=None, - alias="archiveLocation", - description=( - "Location in which all files related to the step will be stored (logs," - " artifacts, etc...). Can be overridden by individual items in Outputs. If" - " omitted, will use the default artifact repository location configured in" - " the controller, appended with the / in the key." - ), - ) - automount_service_account_token: Optional[bool] = Field( - default=None, - alias="automountServiceAccountToken", - description=( - "AutomountServiceAccountToken indicates whether a service account token" - " should be automatically mounted in pods. ServiceAccountName of" - " ExecutorConfig must be specified if this value is false." - ), - ) - container: Optional[v1.Container] = Field( - default=None, - description="Container is the main container image to run in the pod", - ) - container_set: Optional[ContainerSetTemplate] = Field( - default=None, - alias="containerSet", - description="ContainerSet groups multiple containers within a single pod.", - ) - daemon: Optional[bool] = Field( - default=None, - description=( - "Deamon will allow a workflow to proceed to the next step so long as the" " container reaches readiness" - ), - ) - dag: Optional[DAGTemplate] = Field(default=None, description="DAG template subtype which runs a DAG") - data: Optional[Data] = Field(default=None, description="Data is a data template") - executor: Optional[ExecutorConfig] = Field( - default=None, - description="Executor holds configurations of the executor container.", - ) - fail_fast: Optional[bool] = Field( - default=None, - alias="failFast", - description=( - "FailFast, if specified, will fail this template if any of its child pods" - " has failed. This is useful for when this template is expanded with" - " `withItems`, etc." - ), - ) - host_aliases: Optional[List[v1.HostAlias]] = Field( - default=None, - alias="hostAliases", - description=("HostAliases is an optional list of hosts and IPs that will be injected" " into the pod spec"), - ) - http: Optional[HTTP] = Field(default=None, description="HTTP makes a HTTP request") - init_containers: Optional[List[UserContainer]] = Field( - default=None, - alias="initContainers", - description=("InitContainers is a list of containers which run before the main" " container."), - ) - inputs: Optional[Inputs] = Field( - default=None, - description=("Inputs describe what inputs parameters and artifacts are supplied to this" " template"), - ) - memoize: Optional[Memoize] = Field( - default=None, - description=("Memoize allows templates to use outputs generated from already executed" " templates"), - ) - metadata: Optional[Metadata] = Field( - default=None, - description="Metdata sets the pods's metadata, i.e. annotations and labels", - ) - metrics: Optional[Metrics] = Field( - default=None, - description="Metrics are a list of metrics emitted from this template", - ) - name: Optional[str] = Field(default=None, description="Name is the name of the template") - node_selector: Optional[Dict[str, str]] = Field( - default=None, - alias="nodeSelector", - description=( - "NodeSelector is a selector to schedule this step of the workflow to be run" - " on the selected node(s). Overrides the selector set at the workflow" - " level." - ), - ) - outputs: Optional[Outputs] = Field( - default=None, - description=("Outputs describe the parameters and artifacts that this template produces"), - ) - parallelism: Optional[int] = Field( - default=None, - description=( - "Parallelism limits the max total parallel pods that can execute at the" - " same time within the boundaries of this template invocation. If" - " additional steps/dag templates are invoked, the pods created by those" - " templates will not be counted towards this total." - ), - ) - plugin: Optional[Plugin] = Field(default=None, description="Plugin is a plugin template") - pod_spec_patch: Optional[str] = Field( - default=None, - alias="podSpecPatch", - description=( - "PodSpecPatch holds strategic merge patch to apply against the pod spec." - " Allows parameterization of container fields which are not strings (e.g." - " resource limits)." - ), - ) - priority: Optional[int] = Field(default=None, description="Priority to apply to workflow pods.") - priority_class_name: Optional[str] = Field( - default=None, - alias="priorityClassName", - description="PriorityClassName to apply to workflow pods.", - ) - resource: Optional[ResourceTemplate] = Field( - default=None, - description="Resource template subtype which can run k8s resources", - ) - retry_strategy: Optional[RetryStrategy] = Field( - default=None, - alias="retryStrategy", - description="RetryStrategy describes how to retry a template when it fails", - ) - scheduler_name: Optional[str] = Field( - default=None, - alias="schedulerName", - description=( - "If specified, the pod will be dispatched by specified scheduler. Or it" - " will be dispatched by workflow scope scheduler if specified. If neither" - " specified, the pod will be dispatched by default scheduler." - ), - ) - script: Optional[ScriptTemplate] = Field( - default=None, description="Script runs a portion of code against an interpreter" - ) - security_context: Optional[v1.PodSecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext holds pod-level security attributes and common container" - " settings. Optional: Defaults to empty. See type description for default" - " values of each field." - ), - ) - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - description="ServiceAccountName to apply to workflow pods", - ) - sidecars: Optional[List[UserContainer]] = Field( - default=None, - description=( - "Sidecars is a list of containers which run alongside the main container" - " Sidecars are automatically killed when the main container completes" - ), - ) - steps: Optional[List[ParallelSteps]] = Field( - default=None, - description="Steps define a series of sequential/parallel workflow steps", - ) - suspend: Optional[SuspendTemplate] = Field( - default=None, - description=("Suspend template subtype which can suspend a workflow when reaching the" " step"), - ) - synchronization: Optional[Synchronization] = Field( - default=None, - description=("Synchronization holds synchronization lock configuration for this template"), - ) - timeout: Optional[str] = Field( - default=None, - description=( - "Timeout allows to set the total node execution timeout duration counting" - " from the node's start time. This duration also includes time in which the" - " node spends in Pending state. This duration may not be applied to Step or" - " DAG templates." - ), - ) - tolerations: Optional[List[v1.Toleration]] = Field( - default=None, description="Tolerations to apply to workflow pods." - ) - volumes: Optional[List[v1.Volume]] = Field( - default=None, - description=("Volumes is a list of volumes that can be mounted by containers in a" " template."), - ) +class WorkflowSpec(BaseModel): + active_deadline_seconds: Annotated[ + Optional[int], + Field( + alias="activeDeadlineSeconds", + description=( + "Optional duration in seconds relative to the workflow start time which" + " the workflow is allowed to run before the controller terminates the" + " io.argoproj.workflow.v1alpha1. A value of zero is used to terminate a" + " Running workflow" + ), + ), + ] = None + affinity: Annotated[ + Optional[v1.Affinity], + Field( + description=( + "Affinity sets the scheduling constraints for all pods in the" + " io.argoproj.workflow.v1alpha1. Can be overridden by an affinity" + " specified in the template" + ) + ), + ] = None + archive_logs: Annotated[ + Optional[bool], + Field( + alias="archiveLogs", + description=("ArchiveLogs indicates if the container logs should be archived"), + ), + ] = None + arguments: Annotated[ + Optional[Arguments], + Field( + description=( + "Arguments contain the parameters and artifacts sent to the workflow" + " entrypoint Parameters are referencable globally using the 'workflow'" + " variable prefix. e.g." + " {{io.argoproj.workflow.v1alpha1.parameters.myparam}}" + ) + ), + ] = None + artifact_gc: Annotated[ + Optional[ArtifactGC], + Field( + alias="artifactGC", + description=( + "ArtifactGC describes the strategy to use when deleting artifacts from" + " completed or deleted workflows (applies to all output Artifacts" + " unless Artifact.ArtifactGC is specified, which overrides this)" + ), + ), + ] = None + artifact_repository_ref: Annotated[ + Optional[ArtifactRepositoryRef], + Field( + alias="artifactRepositoryRef", + description=( + "ArtifactRepositoryRef specifies the configMap name and key containing" + " the artifact repository config." + ), + ), + ] = None + automount_service_account_token: Annotated[ + Optional[bool], + Field( + alias="automountServiceAccountToken", + description=( + "AutomountServiceAccountToken indicates whether a service account token" + " should be automatically mounted in pods. ServiceAccountName of" + " ExecutorConfig must be specified if this value is false." + ), + ), + ] = None + dns_config: Annotated[ + Optional[v1.PodDNSConfig], + Field( + alias="dnsConfig", + description=( + "PodDNSConfig defines the DNS parameters of a pod in addition to those" " generated from DNSPolicy." + ), + ), + ] = None + dns_policy: Annotated[ + Optional[str], + Field( + alias="dnsPolicy", + description=( + 'Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values' + " are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or" + " 'None'. DNS parameters given in DNSConfig will be merged with the" + " policy selected with DNSPolicy. To have DNS options set along with" + " hostNetwork, you have to specify DNS policy explicitly to" + " 'ClusterFirstWithHostNet'." + ), + ), + ] = None + entrypoint: Annotated[ + Optional[str], + Field( + description=( + "Entrypoint is a template reference to the starting point of the" " io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + executor: Annotated[ + Optional[ExecutorConfig], + Field( + description=( + "Executor holds configurations of executor containers of the" " io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + hooks: Annotated[ + Optional[Dict[str, LifecycleHook]], + Field( + description=( + "Hooks holds the lifecycle hook which is invoked at lifecycle of step," + " irrespective of the success, failure, or error status of the primary" + " step" + ) + ), + ] = None + host_aliases: Annotated[Optional[List[v1.HostAlias]], Field(alias="hostAliases")] = None + host_network: Annotated[ + Optional[bool], + Field( + alias="hostNetwork", + description=("Host networking requested for this workflow pod. Default to false."), + ), + ] = None + image_pull_secrets: Annotated[ + Optional[List[v1.LocalObjectReference]], + Field( + alias="imagePullSecrets", + description=( + "ImagePullSecrets is a list of references to secrets in the same" + " namespace to use for pulling any images in pods that reference this" + " ServiceAccount. ImagePullSecrets are distinct from Secrets because" + " Secrets can be mounted in the pod, but ImagePullSecrets are only" + " accessed by the kubelet. More info:" + " https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod" + ), + ), + ] = None + metrics: Annotated[ + Optional[Metrics], + Field(description="Metrics are a list of metrics emitted from this Workflow"), + ] = None + node_selector: Annotated[ + Optional[Dict[str, str]], + Field( + alias="nodeSelector", + description=( + "NodeSelector is a selector which will result in all pods of the" + " workflow to be scheduled on the selected node(s). This is able to be" + " overridden by a nodeSelector specified in the template." + ), + ), + ] = None + on_exit: Annotated[ + Optional[str], + Field( + alias="onExit", + description=( + "OnExit is a template reference which is invoked at the end of the" + " workflow, irrespective of the success, failure, or error of the" + " primary io.argoproj.workflow.v1alpha1." + ), + ), + ] = None + parallelism: Annotated[ + Optional[int], + Field( + description=( + "Parallelism limits the max total parallel pods that can execute at the" " same time in a workflow" + ) + ), + ] = None + pod_disruption_budget: Annotated[ + Optional[v1beta1.PodDisruptionBudgetSpec], + Field( + alias="podDisruptionBudget", + description=( + "PodDisruptionBudget holds the number of concurrent disruptions that" + " you allow for Workflow's Pods. Controller will automatically add the" + " selector with workflow name, if selector is empty. Optional: Defaults" + " to empty." + ), + ), + ] = None + pod_gc: Annotated[ + Optional[PodGC], + Field( + alias="podGC", + description=("PodGC describes the strategy to use when deleting completed pods"), + ), + ] = None + pod_metadata: Annotated[ + Optional[Metadata], + Field( + alias="podMetadata", + description=("PodMetadata defines additional metadata that should be applied to" " workflow pods"), + ), + ] = None + pod_priority: Annotated[ + Optional[int], + Field( + alias="podPriority", + description=("Priority to apply to workflow pods. DEPRECATED: Use" " PodPriorityClassName instead."), + ), + ] = None + pod_priority_class_name: Annotated[ + Optional[str], + Field( + alias="podPriorityClassName", + description="PriorityClassName to apply to workflow pods.", + ), + ] = None + pod_spec_patch: Annotated[ + Optional[str], + Field( + alias="podSpecPatch", + description=( + "PodSpecPatch holds strategic merge patch to apply against the pod" + " spec. Allows parameterization of container fields which are not" + " strings (e.g. resource limits)." + ), + ), + ] = None + priority: Annotated[ + Optional[int], + Field( + description=( + "Priority is used if controller is configured to process limited number" + " of workflows in parallel. Workflows with higher priority are" + " processed first." + ) + ), + ] = None + retry_strategy: Annotated[ + Optional[RetryStrategy], + Field( + alias="retryStrategy", + description=("RetryStrategy for all templates in the io.argoproj.workflow.v1alpha1."), + ), + ] = None + scheduler_name: Annotated[ + Optional[str], + Field( + alias="schedulerName", + description=( + "Set scheduler name for all pods. Will be overridden if" + " container/script template's scheduler name is set. Default scheduler" + " will be used if neither specified." + ), + ), + ] = None + security_context: Annotated[ + Optional[v1.PodSecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext holds pod-level security attributes and common" + " container settings. Optional: Defaults to empty. See type" + " description for default values of each field." + ), + ), + ] = None + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + description=( + "ServiceAccountName is the name of the ServiceAccount to run all pods" " of the workflow as." + ), + ), + ] = None + shutdown: Annotated[ + Optional[str], + Field(description=("Shutdown will shutdown the workflow according to its ShutdownStrategy")), + ] = None + suspend: Annotated[ + Optional[bool], + Field( + description=( + "Suspend will suspend the workflow and prevent execution of any future" " steps in the workflow" + ) + ), + ] = None + synchronization: Annotated[ + Optional[Synchronization], + Field(description=("Synchronization holds synchronization lock configuration for this" " Workflow")), + ] = None + template_defaults: Annotated[ + Optional[Template], + Field( + alias="templateDefaults", + description=( + "TemplateDefaults holds default template values that will apply to all" + " templates in the Workflow, unless overridden on the template-level" + ), + ), + ] = None + templates: Annotated[ + Optional[List[Template]], + Field(description="Templates is a list of workflow templates used in a workflow"), + ] = None + tolerations: Annotated[ + Optional[List[v1.Toleration]], + Field(description="Tolerations to apply to workflow pods."), + ] = None + ttl_strategy: Annotated[ + Optional[TTLStrategy], + Field( + alias="ttlStrategy", + description=( + "TTLStrategy limits the lifetime of a Workflow that has finished" + " execution depending on if it Succeeded or Failed. If this struct is" + " set, once the Workflow finishes, it will be deleted after the time to" + " live expires. If this field is unset, the controller config map will" + " hold the default values." + ), + ), + ] = None + volume_claim_gc: Annotated[ + Optional[VolumeClaimGC], + Field( + alias="volumeClaimGC", + description=( + "VolumeClaimGC describes the strategy to use when deleting volumes from" " completed workflows" + ), + ), + ] = None + volume_claim_templates: Annotated[ + Optional[List[v1.PersistentVolumeClaim]], + Field( + alias="volumeClaimTemplates", + description=( + "VolumeClaimTemplates is a list of claims that containers are allowed" + " to reference. The Workflow controller will create the claims at the" + " beginning of the workflow and delete the claims upon completion of" + " the workflow" + ), + ), + ] = None + volumes: Annotated[ + Optional[List[v1.Volume]], + Field( + description=( + "Volumes is a list of volumes that can be mounted by containers in a" " io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + workflow_metadata: Annotated[ + Optional[WorkflowMetadata], + Field( + alias="workflowMetadata", + description=("WorkflowMetadata contains some metadata of the workflow to refer to"), + ), + ] = None + workflow_template_ref: Annotated[ + Optional[WorkflowTemplateRef], + Field( + alias="workflowTemplateRef", + description=("WorkflowTemplateRef holds a reference to a WorkflowTemplate for" " execution"), + ), + ] = None -class UpdateCronWorkflowRequest(BaseModel): - cron_workflow: Optional[CronWorkflow] = Field(default=None, alias="cronWorkflow") - name: Optional[str] = Field(default=None, description="DEPRECATED: This field is ignored.") - namespace: Optional[str] = None +class WorkflowStep(BaseModel): + arguments: Annotated[ + Optional[Arguments], + Field(description="Arguments hold arguments to the template"), + ] = None + continue_on: Annotated[ + Optional[ContinueOn], + Field( + alias="continueOn", + description=( + "ContinueOn makes argo to proceed with the following step even if this" + " step fails. Errors and Failed states can be specified" + ), + ), + ] = None + hooks: Annotated[ + Optional[Dict[str, LifecycleHook]], + Field( + description=( + "Hooks holds the lifecycle hook which is invoked at lifecycle of step," + " irrespective of the success, failure, or error status of the primary" + " step" + ) + ), + ] = None + inline: Annotated[ + Optional[Template], + Field(description=("Inline is the template. Template must be empty if this is declared" " (and vice-versa).")), + ] = None + name: Annotated[Optional[str], Field(description="Name of the step")] = None + on_exit: Annotated[ + Optional[str], + Field( + alias="onExit", + description=( + "OnExit is a template reference which is invoked at the end of the" + " template, irrespective of the success, failure, or error of the" + " primary template. DEPRECATED: Use Hooks[exit].Template instead." + ), + ), + ] = None + template: Annotated[ + Optional[str], + Field(description="Template is the name of the template to execute as the step"), + ] = None + template_ref: Annotated[ + Optional[TemplateRef], + Field( + alias="templateRef", + description=("TemplateRef is the reference to the template resource to execute as" " the step."), + ), + ] = None + when: Annotated[ + Optional[str], + Field(description=("When is an expression in which the step should conditionally execute")), + ] = None + with_items: Annotated[ + Optional[List[Item]], + Field( + alias="withItems", + description=("WithItems expands a step into multiple parallel steps from the items" " in the list"), + ), + ] = None + with_param: Annotated[ + Optional[str], + Field( + alias="withParam", + description=( + "WithParam expands a step into multiple parallel steps from the value" + " in the parameter, which is expected to be a JSON list." + ), + ), + ] = None + with_sequence: Annotated[ + Optional[Sequence], + Field( + alias="withSequence", + description="WithSequence expands a step into a numeric sequence", + ), + ] = None -class Workflow(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) +class ClusterWorkflowTemplate(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ObjectMeta spec: WorkflowSpec - status: Optional[WorkflowStatus] = None -class WorkflowCreateRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") - instance_id: Optional[str] = Field(default=None, alias="instanceID", description="This field is no longer used.") - namespace: Optional[str] = None - server_dry_run: Optional[bool] = Field(default=None, alias="serverDryRun") - workflow: Optional[Workflow] = None +class CronWorkflowSpec(BaseModel): + concurrency_policy: Annotated[ + Optional[str], + Field( + alias="concurrencyPolicy", + description=("ConcurrencyPolicy is the K8s-style concurrency policy that will be" " used"), + ), + ] = None + failed_jobs_history_limit: Annotated[ + Optional[int], + Field( + alias="failedJobsHistoryLimit", + description=("FailedJobsHistoryLimit is the number of failed jobs to be kept at a" " time"), + ), + ] = None + schedule: Annotated[ + str, + Field(description="Schedule is a schedule to run the Workflow in Cron format"), + ] + starting_deadline_seconds: Annotated[ + Optional[int], + Field( + alias="startingDeadlineSeconds", + description=( + "StartingDeadlineSeconds is the K8s-style deadline that will limit the" + " time a CronWorkflow will be run after its original scheduled time if" + " it is missed." + ), + ), + ] = None + successful_jobs_history_limit: Annotated[ + Optional[int], + Field( + alias="successfulJobsHistoryLimit", + description=("SuccessfulJobsHistoryLimit is the number of successful jobs to be kept" " at a time"), + ), + ] = None + suspend: Annotated[ + Optional[bool], + Field(description=("Suspend is a flag that will stop new CronWorkflows from running if set" " to true")), + ] = None + timezone: Annotated[ + Optional[str], + Field( + description=( + "Timezone is the timezone against which the cron schedule will be" + ' calculated, e.g. "Asia/Tokyo". Default is machine\'s local time.' + ) + ), + ] = None + workflow_metadata: Annotated[ + Optional[v1_1.ObjectMeta], + Field( + alias="workflowMetadata", + description=("WorkflowMetadata contains some metadata of the workflow to be run"), + ), + ] = None + workflow_spec: Annotated[ + WorkflowSpec, + Field( + alias="workflowSpec", + description="WorkflowSpec is the spec of the workflow to be run", + ), + ] -class WorkflowLintRequest(BaseModel): - namespace: Optional[str] = None - workflow: Optional[Workflow] = None +class WorkflowStatus(BaseModel): + artifact_gc_status: Annotated[ + Optional[ArtGCStatus], + Field( + alias="artifactGCStatus", + description=("ArtifactGCStatus maintains the status of Artifact Garbage Collection"), + ), + ] = None + artifact_repository_ref: Annotated[ + Optional[ArtifactRepositoryRefStatus], + Field( + alias="artifactRepositoryRef", + description=( + "ArtifactRepositoryRef is used to cache the repository to use so we do" + " not need to determine it everytime we reconcile." + ), + ), + ] = None + compressed_nodes: Annotated[ + Optional[str], + Field( + alias="compressedNodes", + description="Compressed and base64 decoded Nodes map", + ), + ] = None + conditions: Annotated[ + Optional[List[Condition]], + Field(description="Conditions is a list of conditions the Workflow may have"), + ] = None + estimated_duration: Annotated[ + Optional[int], + Field(alias="estimatedDuration", description="EstimatedDuration in seconds."), + ] = None + finished_at: Annotated[ + Optional[v1_1.Time], + Field(alias="finishedAt", description="Time at which this workflow completed"), + ] = None + message: Annotated[ + Optional[str], + Field( + description=("A human readable message indicating details about why the workflow is" " in this condition.") + ), + ] = None + nodes: Annotated[ + Optional[Dict[str, NodeStatus]], + Field(description="Nodes is a mapping between a node ID and the node's status."), + ] = None + offload_node_status_version: Annotated[ + Optional[str], + Field( + alias="offloadNodeStatusVersion", + description=( + "Whether on not node status has been offloaded to a database. If" + " exists, then Nodes and CompressedNodes will be empty. This will" + " actually be populated with a hash of the offloaded data." + ), + ), + ] = None + outputs: Annotated[ + Optional[Outputs], + Field( + description=( + "Outputs captures output values and artifact locations produced by the" " workflow via global outputs" + ) + ), + ] = None + persistent_volume_claims: Annotated[ + Optional[List[v1.Volume]], + Field( + alias="persistentVolumeClaims", + description=( + "PersistentVolumeClaims tracks all PVCs that were created as part of" + " the io.argoproj.workflow.v1alpha1. The contents of this list are" + " drained at the end of the workflow." + ), + ), + ] = None + phase: Annotated[ + Optional[str], + Field(description=("Phase a simple, high-level summary of where the workflow is in its" " lifecycle.")), + ] = None + progress: Annotated[Optional[str], Field(description="Progress to completion")] = None + resources_duration: Annotated[ + Optional[Dict[str, int]], + Field( + alias="resourcesDuration", + description="ResourcesDuration is the total for the workflow", + ), + ] = None + started_at: Annotated[ + Optional[v1_1.Time], + Field(alias="startedAt", description="Time at which this workflow started"), + ] = None + stored_templates: Annotated[ + Optional[Dict[str, Template]], + Field( + alias="storedTemplates", + description=("StoredTemplates is a mapping between a template ref and the node's" " status."), + ), + ] = None + stored_workflow_template_spec: Annotated[ + Optional[WorkflowSpec], + Field( + alias="storedWorkflowTemplateSpec", + description=("StoredWorkflowSpec stores the WorkflowTemplate spec for future" " execution."), + ), + ] = None + synchronization: Annotated[ + Optional[SynchronizationStatus], + Field(description="Synchronization stores the status of synchronization locks"), + ] = None -class WorkflowList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[Workflow]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ListMeta +class WorkflowTemplate(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ObjectMeta + spec: WorkflowSpec -class WorkflowSpec(BaseModel): - active_deadline_seconds: Optional[int] = Field( - default=None, - alias="activeDeadlineSeconds", - description=( - "Optional duration in seconds relative to the workflow start time which the" - " workflow is allowed to run before the controller terminates the" - " io.argoproj.workflow.v1alpha1. A value of zero is used to terminate a" - " Running workflow" - ), - ) - affinity: Optional[v1.Affinity] = Field( - default=None, - description=( - "Affinity sets the scheduling constraints for all pods in the" - " io.argoproj.workflow.v1alpha1. Can be overridden by an affinity specified" - " in the template" - ), - ) - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs indicates if the container logs should be archived", - ) - arguments: Optional[Arguments] = Field( - default=None, - description=( - "Arguments contain the parameters and artifacts sent to the workflow" - " entrypoint Parameters are referencable globally using the 'workflow'" - " variable prefix. e.g." - " {{io.argoproj.workflow.v1alpha1.parameters.myparam}}" - ), - ) - artifact_gc: Optional[ArtifactGC] = Field( - default=None, - alias="artifactGC", - description=( - "ArtifactGC describes the strategy to use when deleting artifacts from" - " completed or deleted workflows (applies to all output Artifacts unless" - " Artifact.ArtifactGC is specified, which overrides this)" - ), - ) - artifact_repository_ref: Optional[ArtifactRepositoryRef] = Field( - default=None, - alias="artifactRepositoryRef", - description=( - "ArtifactRepositoryRef specifies the configMap name and key containing the" " artifact repository config." - ), - ) - automount_service_account_token: Optional[bool] = Field( - default=None, - alias="automountServiceAccountToken", - description=( - "AutomountServiceAccountToken indicates whether a service account token" - " should be automatically mounted in pods. ServiceAccountName of" - " ExecutorConfig must be specified if this value is false." - ), - ) - dns_config: Optional[v1.PodDNSConfig] = Field( - default=None, - alias="dnsConfig", - description=( - "PodDNSConfig defines the DNS parameters of a pod in addition to those" " generated from DNSPolicy." - ), - ) - dns_policy: Optional[str] = Field( - default=None, - alias="dnsPolicy", - description=( - 'Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values are' - " 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'." - " DNS parameters given in DNSConfig will be merged with the policy selected" - " with DNSPolicy. To have DNS options set along with hostNetwork, you have" - " to specify DNS policy explicitly to 'ClusterFirstWithHostNet'." - ), - ) - entrypoint: Optional[str] = Field( - default=None, - description=( - "Entrypoint is a template reference to the starting point of the" " io.argoproj.workflow.v1alpha1." - ), - ) - executor: Optional[ExecutorConfig] = Field( - default=None, - description=("Executor holds configurations of executor containers of the" " io.argoproj.workflow.v1alpha1."), - ) - hooks: Optional[Dict[str, LifecycleHook]] = Field( - default=None, - description=( - "Hooks holds the lifecycle hook which is invoked at lifecycle of step," - " irrespective of the success, failure, or error status of the primary step" - ), - ) - host_aliases: Optional[List[v1.HostAlias]] = Field(default=None, alias="hostAliases") - host_network: Optional[bool] = Field( - default=None, - alias="hostNetwork", - description=("Host networking requested for this workflow pod. Default to false."), - ) - image_pull_secrets: Optional[List[v1.LocalObjectReference]] = Field( - default=None, - alias="imagePullSecrets", - description=( - "ImagePullSecrets is a list of references to secrets in the same namespace" - " to use for pulling any images in pods that reference this ServiceAccount." - " ImagePullSecrets are distinct from Secrets because Secrets can be mounted" - " in the pod, but ImagePullSecrets are only accessed by the kubelet. More" - " info:" - " https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod" - ), - ) - metrics: Optional[Metrics] = Field( - default=None, - description="Metrics are a list of metrics emitted from this Workflow", - ) - node_selector: Optional[Dict[str, str]] = Field( - default=None, - alias="nodeSelector", - description=( - "NodeSelector is a selector which will result in all pods of the workflow" - " to be scheduled on the selected node(s). This is able to be overridden by" - " a nodeSelector specified in the template." - ), - ) - on_exit: Optional[str] = Field( - default=None, - alias="onExit", - description=( - "OnExit is a template reference which is invoked at the end of the" - " workflow, irrespective of the success, failure, or error of the primary" - " io.argoproj.workflow.v1alpha1." - ), - ) - parallelism: Optional[int] = Field( - default=None, - description=( - "Parallelism limits the max total parallel pods that can execute at the" " same time in a workflow" - ), - ) - pod_disruption_budget: Optional[v1beta1.PodDisruptionBudgetSpec] = Field( - default=None, - alias="podDisruptionBudget", - description=( - "PodDisruptionBudget holds the number of concurrent disruptions that you" - " allow for Workflow's Pods. Controller will automatically add the selector" - " with workflow name, if selector is empty. Optional: Defaults to empty." - ), - ) - pod_gc: Optional[PodGC] = Field( - default=None, - alias="podGC", - description="PodGC describes the strategy to use when deleting completed pods", - ) - pod_metadata: Optional[Metadata] = Field( - default=None, - alias="podMetadata", - description=("PodMetadata defines additional metadata that should be applied to workflow" " pods"), - ) - pod_priority: Optional[int] = Field( - default=None, - alias="podPriority", - description=("Priority to apply to workflow pods. DEPRECATED: Use PodPriorityClassName" " instead."), - ) - pod_priority_class_name: Optional[str] = Field( - default=None, - alias="podPriorityClassName", - description="PriorityClassName to apply to workflow pods.", - ) - pod_spec_patch: Optional[str] = Field( - default=None, - alias="podSpecPatch", - description=( - "PodSpecPatch holds strategic merge patch to apply against the pod spec." - " Allows parameterization of container fields which are not strings (e.g." - " resource limits)." - ), - ) - priority: Optional[int] = Field( - default=None, - description=( - "Priority is used if controller is configured to process limited number of" - " workflows in parallel. Workflows with higher priority are processed" - " first." - ), - ) - retry_strategy: Optional[RetryStrategy] = Field( - default=None, - alias="retryStrategy", - description=("RetryStrategy for all templates in the io.argoproj.workflow.v1alpha1."), - ) - scheduler_name: Optional[str] = Field( - default=None, - alias="schedulerName", - description=( - "Set scheduler name for all pods. Will be overridden if container/script" - " template's scheduler name is set. Default scheduler will be used if" - " neither specified." - ), - ) - security_context: Optional[v1.PodSecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext holds pod-level security attributes and common container" - " settings. Optional: Defaults to empty. See type description for default" - " values of each field." - ), - ) - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - description=("ServiceAccountName is the name of the ServiceAccount to run all pods of" " the workflow as."), - ) - shutdown: Optional[str] = Field( - default=None, - description=("Shutdown will shutdown the workflow according to its ShutdownStrategy"), - ) - suspend: Optional[bool] = Field( - default=None, - description=("Suspend will suspend the workflow and prevent execution of any future" " steps in the workflow"), - ) - synchronization: Optional[Synchronization] = Field( - default=None, - description=("Synchronization holds synchronization lock configuration for this Workflow"), - ) - template_defaults: Optional[Template] = Field( - default=None, - alias="templateDefaults", - description=( - "TemplateDefaults holds default template values that will apply to all" - " templates in the Workflow, unless overridden on the template-level" - ), - ) - templates: Optional[List[Template]] = Field( - default=None, - description="Templates is a list of workflow templates used in a workflow", - ) - tolerations: Optional[List[v1.Toleration]] = Field( - default=None, description="Tolerations to apply to workflow pods." - ) - ttl_strategy: Optional[TTLStrategy] = Field( - default=None, - alias="ttlStrategy", - description=( - "TTLStrategy limits the lifetime of a Workflow that has finished execution" - " depending on if it Succeeded or Failed. If this struct is set, once the" - " Workflow finishes, it will be deleted after the time to live expires. If" - " this field is unset, the controller config map will hold the default" - " values." - ), - ) - volume_claim_gc: Optional[VolumeClaimGC] = Field( - default=None, - alias="volumeClaimGC", - description=("VolumeClaimGC describes the strategy to use when deleting volumes from" " completed workflows"), - ) - volume_claim_templates: Optional[List[v1.PersistentVolumeClaim]] = Field( - default=None, - alias="volumeClaimTemplates", - description=( - "VolumeClaimTemplates is a list of claims that containers are allowed to" - " reference. The Workflow controller will create the claims at the" - " beginning of the workflow and delete the claims upon completion of the" - " workflow" - ), - ) - volumes: Optional[List[v1.Volume]] = Field( - default=None, - description=( - "Volumes is a list of volumes that can be mounted by containers in a" " io.argoproj.workflow.v1alpha1." - ), - ) - workflow_metadata: Optional[WorkflowMetadata] = Field( - default=None, - alias="workflowMetadata", - description=("WorkflowMetadata contains some metadata of the workflow to refer to"), - ) - workflow_template_ref: Optional[WorkflowTemplateRef] = Field( - default=None, - alias="workflowTemplateRef", - description=("WorkflowTemplateRef holds a reference to a WorkflowTemplate for execution"), - ) +class ClusterWorkflowTemplateCreateRequest(BaseModel): + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None + template: Optional[ClusterWorkflowTemplate] = None -class WorkflowStatus(BaseModel): - artifact_gc_status: Optional[ArtGCStatus] = Field( - default=None, - alias="artifactGCStatus", - description=("ArtifactGCStatus maintains the status of Artifact Garbage Collection"), - ) - artifact_repository_ref: Optional[ArtifactRepositoryRefStatus] = Field( - default=None, - alias="artifactRepositoryRef", - description=( - "ArtifactRepositoryRef is used to cache the repository to use so we do not" - " need to determine it everytime we reconcile." - ), - ) - compressed_nodes: Optional[str] = Field( - default=None, - alias="compressedNodes", - description="Compressed and base64 decoded Nodes map", - ) - conditions: Optional[List[Condition]] = Field( - default=None, - description="Conditions is a list of conditions the Workflow may have", - ) - estimated_duration: Optional[int] = Field( - default=None, - alias="estimatedDuration", - description="EstimatedDuration in seconds.", - ) - finished_at: Optional[v1_1.Time] = Field( - default=None, - alias="finishedAt", - description="Time at which this workflow completed", - ) - message: Optional[str] = Field( - default=None, - description=("A human readable message indicating details about why the workflow is in" " this condition."), - ) - nodes: Optional[Dict[str, NodeStatus]] = Field( - default=None, - description="Nodes is a mapping between a node ID and the node's status.", - ) - offload_node_status_version: Optional[str] = Field( - default=None, - alias="offloadNodeStatusVersion", - description=( - "Whether on not node status has been offloaded to a database. If exists," - " then Nodes and CompressedNodes will be empty. This will actually be" - " populated with a hash of the offloaded data." - ), - ) - outputs: Optional[Outputs] = Field( - default=None, - description=( - "Outputs captures output values and artifact locations produced by the" " workflow via global outputs" - ), - ) - persistent_volume_claims: Optional[List[v1.Volume]] = Field( - default=None, - alias="persistentVolumeClaims", - description=( - "PersistentVolumeClaims tracks all PVCs that were created as part of the" - " io.argoproj.workflow.v1alpha1. The contents of this list are drained at" - " the end of the workflow." - ), - ) - phase: Optional[str] = Field( - default=None, - description=("Phase a simple, high-level summary of where the workflow is in its" " lifecycle."), - ) - progress: Optional[str] = Field(default=None, description="Progress to completion") - resources_duration: Optional[Dict[str, int]] = Field( - default=None, - alias="resourcesDuration", - description="ResourcesDuration is the total for the workflow", - ) - started_at: Optional[v1_1.Time] = Field( - default=None, - alias="startedAt", - description="Time at which this workflow started", - ) - stored_templates: Optional[Dict[str, Template]] = Field( - default=None, - alias="storedTemplates", - description=("StoredTemplates is a mapping between a template ref and the node's status."), - ) - stored_workflow_template_spec: Optional[WorkflowSpec] = Field( - default=None, - alias="storedWorkflowTemplateSpec", - description=("StoredWorkflowSpec stores the WorkflowTemplate spec for future execution."), - ) - synchronization: Optional[SynchronizationStatus] = Field( - default=None, - description="Synchronization stores the status of synchronization locks", - ) +class ClusterWorkflowTemplateLintRequest(BaseModel): + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None + template: Optional[ClusterWorkflowTemplate] = None -class WorkflowStep(BaseModel): - arguments: Optional[Arguments] = Field(default=None, description="Arguments hold arguments to the template") - continue_on: Optional[ContinueOn] = Field( - default=None, - alias="continueOn", - description=( - "ContinueOn makes argo to proceed with the following step even if this step" - " fails. Errors and Failed states can be specified" - ), - ) - hooks: Optional[Dict[str, LifecycleHook]] = Field( - default=None, - description=( - "Hooks holds the lifecycle hook which is invoked at lifecycle of step," - " irrespective of the success, failure, or error status of the primary step" - ), - ) - inline: Optional[Template] = Field( - default=None, - description=("Inline is the template. Template must be empty if this is declared (and" " vice-versa)."), - ) - name: Optional[str] = Field(default=None, description="Name of the step") - on_exit: Optional[str] = Field( - default=None, - alias="onExit", - description=( - "OnExit is a template reference which is invoked at the end of the" - " template, irrespective of the success, failure, or error of the primary" - " template. DEPRECATED: Use Hooks[exit].Template instead." - ), - ) - template: Optional[str] = Field( - default=None, - description="Template is the name of the template to execute as the step", - ) - template_ref: Optional[TemplateRef] = Field( - default=None, - alias="templateRef", - description=("TemplateRef is the reference to the template resource to execute as the" " step."), - ) - when: Optional[str] = Field( - default=None, - description=("When is an expression in which the step should conditionally execute"), - ) - with_items: Optional[List[Item]] = Field( - default=None, - alias="withItems", - description=("WithItems expands a step into multiple parallel steps from the items in" " the list"), - ) - with_param: Optional[str] = Field( - default=None, - alias="withParam", - description=( - "WithParam expands a step into multiple parallel steps from the value in" - " the parameter, which is expected to be a JSON list." - ), - ) - with_sequence: Optional[Sequence] = Field( - default=None, - alias="withSequence", - description="WithSequence expands a step into a numeric sequence", - ) +class ClusterWorkflowTemplateUpdateRequest(BaseModel): + name: Annotated[Optional[str], Field(description="DEPRECATED: This field is ignored.")] = None + template: Optional[ClusterWorkflowTemplate] = None -class WorkflowTaskSetSpec(BaseModel): - tasks: Optional[Dict[str, Template]] = None +class CronWorkflow(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ObjectMeta + spec: CronWorkflowSpec + status: Optional[CronWorkflowStatus] = None -class WorkflowTemplate(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) +class Workflow(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ObjectMeta spec: WorkflowSpec + status: Optional[WorkflowStatus] = None class WorkflowTemplateCreateRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None namespace: Optional[str] = None template: Optional[WorkflowTemplate] = None class WorkflowTemplateLintRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None namespace: Optional[str] = None template: Optional[WorkflowTemplate] = None -class WorkflowTemplateList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[WorkflowTemplate]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ListMeta - - class WorkflowTemplateUpdateRequest(BaseModel): - name: Optional[str] = Field(default=None, description="DEPRECATED: This field is ignored.") + name: Annotated[Optional[str], Field(description="DEPRECATED: This field is ignored.")] = None namespace: Optional[str] = None template: Optional[WorkflowTemplate] = None +class CreateCronWorkflowRequest(BaseModel): + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None + cron_workflow: Annotated[Optional[CronWorkflow], Field(alias="cronWorkflow")] = None + namespace: Optional[str] = None + + +class LintCronWorkflowRequest(BaseModel): + cron_workflow: Annotated[Optional[CronWorkflow], Field(alias="cronWorkflow")] = None + namespace: Optional[str] = None + + +class UpdateCronWorkflowRequest(BaseModel): + cron_workflow: Annotated[Optional[CronWorkflow], Field(alias="cronWorkflow")] = None + name: Annotated[Optional[str], Field(description="DEPRECATED: This field is ignored.")] = None + namespace: Optional[str] = None + + +class WorkflowCreateRequest(BaseModel): + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None + instance_id: Annotated[ + Optional[str], + Field(alias="instanceID", description="This field is no longer used."), + ] = None + namespace: Optional[str] = None + server_dry_run: Annotated[Optional[bool], Field(alias="serverDryRun")] = None + workflow: Optional[Workflow] = None + + +class WorkflowLintRequest(BaseModel): + namespace: Optional[str] = None + workflow: Optional[Workflow] = None + + class WorkflowWatchEvent(BaseModel): - object: Optional[Workflow] = Field(default=None, title="the workflow") - type: Optional[str] = Field(default=None, title="the type of change") + object: Annotated[Optional[Workflow], Field(title="the workflow")] = None + type: Annotated[Optional[str], Field(title="the type of change")] = None -ClusterWorkflowTemplate.update_forward_refs() -CreateCronWorkflowRequest.update_forward_refs() -CronWorkflow.update_forward_refs() -CronWorkflowSpec.update_forward_refs() -DAGTask.update_forward_refs() +DAGTemplate.update_forward_refs() ParallelSteps.update_forward_refs() -Workflow.update_forward_refs() +WorkflowTaskSetSpec.update_forward_refs() +ClusterWorkflowTemplateList.update_forward_refs() +CronWorkflowList.update_forward_refs() +WorkflowList.update_forward_refs() +WorkflowTemplateList.update_forward_refs() diff --git a/src/hera/events/models/io/k8s/api/core/v1.py b/src/hera/events/models/io/k8s/api/core/v1.py index 1d1b69b6f..bf300e635 100644 --- a/src/hera/events/models/io/k8s/api/core/v1.py +++ b/src/hera/events/models/io/k8s/api/core/v1.py @@ -6,6 +6,8 @@ from enum import Enum from typing import Dict, List, Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from ...apimachinery.pkg.api import resource @@ -13,135 +15,195 @@ from ...apimachinery.pkg.util import intstr +class SecretKeySelector(BaseModel): + key: Annotated[ + str, + Field(description=("The key of the secret to select from. Must be a valid secret key.")), + ] + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the Secret or its key must be defined"), + ] = None + + +class ConfigMapKeySelector(BaseModel): + key: Annotated[str, Field(description="The key to select.")] + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the ConfigMap or its key must be defined"), + ] = None + + class AWSElasticBlockStoreVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type of the volume that you want to mount. Tip: Ensure that the" - " filesystem type is supported by the host operating system. Examples:" - ' "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' - " More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - ), - ) - partition: Optional[int] = Field( - default=None, - description=( - "The partition in the volume that you want to mount. If omitted, the" - " default is to mount by volume name. Examples: For volume /dev/sda1, you" - ' specify the partition as "1". Similarly, the volume partition for' - ' /dev/sda is "0" (or you can leave the property empty).' - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - 'Specify "true" to force and set the ReadOnly property in VolumeMounts to' - ' "true". If omitted, the default is "false". More info:' - " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - ), - ) - volume_id: str = Field( - ..., - alias="volumeID", - description=( - "Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More" - " info:" - " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - ), - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type of the volume that you want to mount. Tip: Ensure that" + " the filesystem type is supported by the host operating system." + ' Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if' + " unspecified. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + ), + ), + ] = None + partition: Annotated[ + Optional[int], + Field( + description=( + "The partition in the volume that you want to mount. If omitted, the" + " default is to mount by volume name. Examples: For volume /dev/sda1," + ' you specify the partition as "1". Similarly, the volume partition for' + ' /dev/sda is "0" (or you can leave the property empty).' + ) + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + 'Specify "true" to force and set the ReadOnly property in VolumeMounts' + ' to "true". If omitted, the default is "false". More info:' + " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + ), + ), + ] = None + volume_id: Annotated[ + str, + Field( + alias="volumeID", + description=( + "Unique ID of the persistent disk resource in AWS (Amazon EBS volume)." + " More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + ), + ), + ] class AzureDiskVolumeSource(BaseModel): - caching_mode: Optional[str] = Field( - default=None, - alias="cachingMode", - description="Host Caching mode: None, Read Only, Read Write.", - ) - disk_name: str = Field( - ..., - alias="diskName", - description="The Name of the data disk in the blob storage", - ) - disk_uri: str = Field(..., alias="diskURI", description="The URI the data disk in the blob storage") - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Expected values Shared: multiple blob disks per storage account " - " Dedicated: single blob disk per storage account Managed: azure managed" - " data disk (only in managed availability set). defaults to shared" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." - ), - ) + caching_mode: Annotated[ + Optional[str], + Field( + alias="cachingMode", + description="Host Caching mode: None, Read Only, Read Write.", + ), + ] = None + disk_name: Annotated[ + str, + Field( + alias="diskName", + description="The Name of the data disk in the blob storage", + ), + ] + disk_uri: Annotated[ + str, + Field(alias="diskURI", description="The URI the data disk in the blob storage"), + ] + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Expected values Shared: multiple blob disks per storage account " + " Dedicated: single blob disk per storage account Managed: azure" + " managed data disk (only in managed availability set). defaults to" + " shared" + ) + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), + ), + ] = None class AzureFileVolumeSource(BaseModel): - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), ), - ) - secret_name: str = Field( - ..., - alias="secretName", - description=("the name of secret that contains Azure Storage Account Name and Key"), - ) - share_name: str = Field(..., alias="shareName", description="Share Name") - - -class Capabilities(BaseModel): - add: Optional[List[str]] = Field(default=None, description="Added capabilities") - drop: Optional[List[str]] = Field(default=None, description="Removed capabilities") + ] = None + secret_name: Annotated[ + str, + Field( + alias="secretName", + description=("the name of secret that contains Azure Storage Account Name and Key"), + ), + ] + share_name: Annotated[str, Field(alias="shareName", description="Share Name")] -class ConfigMapEnvSource(BaseModel): - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" +class LocalObjectReference(BaseModel): + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) ), - ) - optional: Optional[bool] = Field(default=None, description="Specify whether the ConfigMap must be defined") + ] = None -class ConfigMapKeySelector(BaseModel): - key: str = Field(..., description="The key to select.") - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the ConfigMap or its key must be defined", - ) +class Capabilities(BaseModel): + add: Annotated[Optional[List[str]], Field(description="Added capabilities")] = None + drop: Annotated[Optional[List[str]], Field(description="Removed capabilities")] = None -class TerminationMessagePolicy(Enum): - fallback_to_logs_on_error = "FallbackToLogsOnError" - file = "File" +class ConfigMapEnvSource(BaseModel): + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the ConfigMap must be defined"), + ] = None class Protocol(Enum): @@ -151,210 +213,348 @@ class Protocol(Enum): class ContainerPort(BaseModel): - container_port: int = Field( - ..., - alias="containerPort", - description=( - "Number of port to expose on the pod's IP address. This must be a valid" " port number, 0 < x < 65536." - ), - ) - host_ip: Optional[str] = Field( - default=None, - alias="hostIP", - description="What host IP to bind the external port to.", - ) - host_port: Optional[int] = Field( - default=None, - alias="hostPort", - description=( - "Number of port to expose on the host. If specified, this must be a valid" - " port number, 0 < x < 65536. If HostNetwork is specified, this must match" - " ContainerPort. Most containers do not need this." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "If specified, this must be an IANA_SVC_NAME and unique within the pod." - " Each named port in a pod must have a unique name. Name for the port that" - " can be referred to by services." - ), - ) - protocol: Optional[Protocol] = Field( - default=None, - description=( - "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to" - ' "TCP".\n\nPossible enum values:\n - `"SCTP"` is the SCTP protocol.\n -' - ' `"TCP"` is the TCP protocol.\n - `"UDP"` is the UDP protocol.' - ), - ) + container_port: Annotated[ + int, + Field( + alias="containerPort", + description=( + "Number of port to expose on the pod's IP address. This must be a valid" " port number, 0 < x < 65536." + ), + ), + ] + host_ip: Annotated[ + Optional[str], + Field(alias="hostIP", description="What host IP to bind the external port to."), + ] = None + host_port: Annotated[ + Optional[int], + Field( + alias="hostPort", + description=( + "Number of port to expose on the host. If specified, this must be a" + " valid port number, 0 < x < 65536. If HostNetwork is specified, this" + " must match ContainerPort. Most containers do not need this." + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "If specified, this must be an IANA_SVC_NAME and unique within the pod." + " Each named port in a pod must have a unique name. Name for the port" + " that can be referred to by services." + ) + ), + ] = None + protocol: Annotated[ + Optional[Protocol], + Field( + description=( + "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to" + ' "TCP".\n\nPossible enum values:\n - `"SCTP"` is the SCTP protocol.\n' + ' - `"TCP"` is the TCP protocol.\n - `"UDP"` is the UDP protocol.' + ) + ), + ] = None + + +class ObjectFieldSelector(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=("Version of the schema the FieldPath is written in terms of, defaults" ' to "v1".'), + ), + ] = None + field_path: Annotated[ + str, + Field( + alias="fieldPath", + description="Path of the field to select in the specified API version.", + ), + ] + + +class SecretEnvSource(BaseModel): + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[Optional[bool], Field(description="Specify whether the Secret must be defined")] = None + + +class ObjectReference(BaseModel): + api_version: Annotated[ + Optional[str], + Field(alias="apiVersion", description="API version of the referent."), + ] = None + field_path: Annotated[ + Optional[str], + Field( + alias="fieldPath", + description=( + "If referring to a piece of an object instead of an entire object, this" + " string should contain a valid JSON/Go field access statement, such as" + " desiredState.manifest.containers[2]. For example, if the object" + " reference is to a container within a pod, this would take on a value" + ' like: "spec.containers{name}" (where "name" refers to the name of the' + " container that triggered the event) or if no container name is" + ' specified "spec.containers[2]" (container with index 2 in this pod).' + " This syntax is chosen only to have some well-defined way of" + " referencing a part of an object." + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind of the referent. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + namespace: Annotated[ + Optional[str], + Field( + description=( + "Namespace of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" + ) + ), + ] = None + resource_version: Annotated[ + Optional[str], + Field( + alias="resourceVersion", + description=( + "Specific resourceVersion to which this reference is made, if any. More" + " info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" + ), + ), + ] = None + uid: Annotated[ + Optional[str], + Field( + description=( + "UID of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids" + ) + ), + ] = None class EventSource(BaseModel): - component: Optional[str] = Field(default=None, description="Component from which the event is generated.") - host: Optional[str] = Field(default=None, description="Node name on which the event is generated.") + component: Annotated[Optional[str], Field(description="Component from which the event is generated.")] = None + host: Annotated[Optional[str], Field(description="Node name on which the event is generated.")] = None class ExecAction(BaseModel): - command: Optional[List[str]] = Field( - default=None, - description=( - "Command is the command line to execute inside the container, the working" - " directory for the command is root ('/') in the container's filesystem." - " The command is simply exec'd, it is not run inside a shell, so" - " traditional shell instructions ('|', etc) won't work. To use a shell, you" - " need to explicitly call out to that shell. Exit status of 0 is treated as" - " live/healthy and non-zero is unhealthy." + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Command is the command line to execute inside the container, the" + " working directory for the command is root ('/') in the container's" + " filesystem. The command is simply exec'd, it is not run inside a" + " shell, so traditional shell instructions ('|', etc) won't work. To" + " use a shell, you need to explicitly call out to that shell. Exit" + " status of 0 is treated as live/healthy and non-zero is unhealthy." + ) ), - ) + ] = None class FCVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - lun: Optional[int] = Field(default=None, description="Optional: FC target lun number") - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Optional: Defaults to false (read/write). ReadOnly here will force the" - " ReadOnly setting in VolumeMounts." - ), - ) - target_ww_ns: Optional[List[str]] = Field( - default=None, - alias="targetWWNs", - description="Optional: FC target worldwide names (WWNs)", - ) - wwids: Optional[List[str]] = Field( - default=None, - description=( - "Optional: FC volume world wide identifiers (wwids) Either wwids or" - " combination of targetWWNs and lun must be set, but not both" - " simultaneously." - ), - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + lun: Annotated[Optional[int], Field(description="Optional: FC target lun number")] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Optional: Defaults to false (read/write). ReadOnly here will force the" + " ReadOnly setting in VolumeMounts." + ), + ), + ] = None + target_ww_ns: Annotated[ + Optional[List[str]], + Field(alias="targetWWNs", description="Optional: FC target worldwide names (WWNs)"), + ] = None + wwids: Annotated[ + Optional[List[str]], + Field( + description=( + "Optional: FC volume world wide identifiers (wwids) Either wwids or" + " combination of targetWWNs and lun must be set, but not both" + " simultaneously." + ) + ), + ] = None class FlockerVolumeSource(BaseModel): - dataset_name: Optional[str] = Field( - default=None, - alias="datasetName", - description=( - "Name of the dataset stored as metadata -> name on the dataset for Flocker" - " should be considered as deprecated" + dataset_name: Annotated[ + Optional[str], + Field( + alias="datasetName", + description=( + "Name of the dataset stored as metadata -> name on the dataset for" + " Flocker should be considered as deprecated" + ), + ), + ] = None + dataset_uuid: Annotated[ + Optional[str], + Field( + alias="datasetUUID", + description=("UUID of the dataset. This is unique identifier of a Flocker dataset"), ), - ) - dataset_uuid: Optional[str] = Field( - default=None, - alias="datasetUUID", - description=("UUID of the dataset. This is unique identifier of a Flocker dataset"), - ) + ] = None class GCEPersistentDiskVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type of the volume that you want to mount. Tip: Ensure that the" - " filesystem type is supported by the host operating system. Examples:" - ' "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' - " More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) - partition: Optional[int] = Field( - default=None, - description=( - "The partition in the volume that you want to mount. If omitted, the" - " default is to mount by volume name. Examples: For volume /dev/sda1, you" - ' specify the partition as "1". Similarly, the volume partition for' - ' /dev/sda is "0" (or you can leave the property empty). More info:' - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) - pd_name: str = Field( - ..., - alias="pdName", - description=( - "Unique name of the PD resource in GCE. Used to identify the disk in GCE." - " More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to" - " false. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type of the volume that you want to mount. Tip: Ensure that" + " the filesystem type is supported by the host operating system." + ' Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if' + " unspecified. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ), + ), + ] = None + partition: Annotated[ + Optional[int], + Field( + description=( + "The partition in the volume that you want to mount. If omitted, the" + " default is to mount by volume name. Examples: For volume /dev/sda1," + ' you specify the partition as "1". Similarly, the volume partition for' + ' /dev/sda is "0" (or you can leave the property empty). More info:' + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ) + ), + ] = None + pd_name: Annotated[ + str, + Field( + alias="pdName", + description=( + "Unique name of the PD resource in GCE. Used to identify the disk in" + " GCE. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ), + ), + ] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the ReadOnly setting in VolumeMounts." + " Defaults to false. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ), + ), + ] = None class GRPCAction(BaseModel): - port: int = Field( - ..., - description=("Port number of the gRPC service. Number must be in the range 1 to 65535."), - ) - service: Optional[str] = Field( - default=None, - description=( - "Service is the name of the service to place in the gRPC HealthCheckRequest" - " (see" - " https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf" - " this is not specified, the default behavior is defined by gRPC." - ), - ) + port: Annotated[ + int, + Field(description=("Port number of the gRPC service. Number must be in the range 1 to" " 65535.")), + ] + service: Annotated[ + Optional[str], + Field( + description=( + "Service is the name of the service to place in the gRPC" + " HealthCheckRequest (see" + " https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf" + " this is not specified, the default behavior is defined by gRPC." + ) + ), + ] = None class GitRepoVolumeSource(BaseModel): - directory: Optional[str] = Field( - default=None, - description=( - "Target directory name. Must not contain or start with '..'. If '.' is" - " supplied, the volume directory will be the git repository. Otherwise, if" - " specified, the volume will contain the git repository in the subdirectory" - " with the given name." + directory: Annotated[ + Optional[str], + Field( + description=( + "Target directory name. Must not contain or start with '..'. If '.' is" + " supplied, the volume directory will be the git repository. " + " Otherwise, if specified, the volume will contain the git repository" + " in the subdirectory with the given name." + ) ), - ) - repository: str = Field(..., description="Repository URL") - revision: Optional[str] = Field(default=None, description="Commit hash for the specified revision.") + ] = None + repository: Annotated[str, Field(description="Repository URL")] + revision: Annotated[Optional[str], Field(description="Commit hash for the specified revision.")] = None class GlusterfsVolumeSource(BaseModel): - endpoints: str = Field( - ..., - description=( - "EndpointsName is the endpoint name that details Glusterfs topology. More" - " info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" - ), - ) - path: str = Field( - ..., - description=( - "Path is the Glusterfs volume path. More info:" - " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the Glusterfs volume to be mounted with read-only" - " permissions. Defaults to false. More info:" - " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" - ), - ) + endpoints: Annotated[ + str, + Field( + description=( + "EndpointsName is the endpoint name that details Glusterfs topology." + " More info:" + " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" + ) + ), + ] + path: Annotated[ + str, + Field( + description=( + "Path is the Glusterfs volume path. More info:" + " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" + ) + ), + ] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the Glusterfs volume to be mounted with" + " read-only permissions. Defaults to false. More info:" + " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" + ), + ), + ] = None class Scheme(Enum): @@ -363,90 +563,95 @@ class Scheme(Enum): class HTTPHeader(BaseModel): - name: str = Field(..., description="The header field name") - value: str = Field(..., description="The header field value") + name: Annotated[str, Field(description="The header field name")] + value: Annotated[str, Field(description="The header field value")] class HostAlias(BaseModel): - hostnames: Optional[List[str]] = Field(default=None, description="Hostnames for the above IP address.") - ip: Optional[str] = Field(default=None, description="IP address of the host file entry.") + hostnames: Annotated[Optional[List[str]], Field(description="Hostnames for the above IP address.")] = None + ip: Annotated[Optional[str], Field(description="IP address of the host file entry.")] = None class HostPathVolumeSource(BaseModel): - path: str = Field( - ..., - description=( - "Path of the directory on the host. If the path is a symlink, it will" - " follow the link to the real path. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" - ), - ) - type: Optional[str] = Field( - default=None, - description=( - 'Type for HostPath Volume Defaults to "" More info:' - " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" - ), - ) + path: Annotated[ + str, + Field( + description=( + "Path of the directory on the host. If the path is a symlink, it will" + " follow the link to the real path. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" + ) + ), + ] + type: Annotated[ + Optional[str], + Field( + description=( + 'Type for HostPath Volume Defaults to "" More info:' + " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" + ) + ), + ] = None class KeyToPath(BaseModel): - key: str = Field(..., description="The key to project.") - mode: Optional[int] = Field( - default=None, - description=( - "Optional: mode bits used to set permissions on this file. Must be an octal" - " value between 0000 and 0777 or a decimal value between 0 and 511. YAML" - " accepts both octal and decimal values, JSON requires decimal values for" - " mode bits. If not specified, the volume defaultMode will be used. This" - " might be in conflict with other options that affect the file mode, like" - " fsGroup, and the result can be other mode bits set." - ), - ) - path: str = Field( - ..., - description=( - "The relative path of the file to map the key to. May not be an absolute" - " path. May not contain the path element '..'. May not start with the" - " string '..'." - ), - ) - - -class LocalObjectReference(BaseModel): - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) + key: Annotated[str, Field(description="The key to project.")] + mode: Annotated[ + Optional[int], + Field( + description=( + "Optional: mode bits used to set permissions on this file. Must be an" + " octal value between 0000 and 0777 or a decimal value between 0 and" + " 511. YAML accepts both octal and decimal values, JSON requires" + " decimal values for mode bits. If not specified, the volume" + " defaultMode will be used. This might be in conflict with other" + " options that affect the file mode, like fsGroup, and the result can" + " be other mode bits set." + ) + ), + ] = None + path: Annotated[ + str, + Field( + description=( + "The relative path of the file to map the key to. May not be an" + " absolute path. May not contain the path element '..'. May not start" + " with the string '..'." + ) + ), + ] class NFSVolumeSource(BaseModel): - path: str = Field( - ..., - description=( - "Path that is exported by the NFS server. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#nfs" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the NFS export to be mounted with read-only" - " permissions. Defaults to false. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#nfs" - ), - ) - server: str = Field( - ..., - description=( - "Server is the hostname or IP address of the NFS server. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#nfs" - ), - ) + path: Annotated[ + str, + Field( + description=( + "Path that is exported by the NFS server. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#nfs" + ) + ), + ] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the NFS export to be mounted with read-only" + " permissions. Defaults to false. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#nfs" + ), + ), + ] = None + server: Annotated[ + str, + Field( + description=( + "Server is the hostname or IP address of the NFS server. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#nfs" + ) + ), + ] class Operator(Enum): @@ -459,113 +664,47 @@ class Operator(Enum): class NodeSelectorRequirement(BaseModel): - key: str = Field(..., description="The label key that the selector applies to.") - operator: Operator = Field( - ..., - description=( - "Represents a key's relationship to a set of values. Valid operators are" - " In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\nPossible enum values:\n -" - ' `"DoesNotExist"`\n - `"Exists"`\n - `"Gt"`\n - `"In"`\n - `"Lt"`\n -' - ' `"NotIn"`' - ), - ) - values: Optional[List[str]] = Field( - default=None, - description=( - "An array of string values. If the operator is In or NotIn, the values" - " array must be non-empty. If the operator is Exists or DoesNotExist, the" - " values array must be empty. If the operator is Gt or Lt, the values array" - " must have a single element, which will be interpreted as an integer. This" - " array is replaced during a strategic merge patch." - ), - ) + key: Annotated[str, Field(description="The label key that the selector applies to.")] + operator: Annotated[ + Operator, + Field( + description=( + "Represents a key's relationship to a set of values. Valid operators" + " are In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\nPossible enum" + ' values:\n - `"DoesNotExist"`\n - `"Exists"`\n - `"Gt"`\n - `"In"`\n -' + ' `"Lt"`\n - `"NotIn"`' + ) + ), + ] + values: Annotated[ + Optional[List[str]], + Field( + description=( + "An array of string values. If the operator is In or NotIn, the values" + " array must be non-empty. If the operator is Exists or DoesNotExist," + " the values array must be empty. If the operator is Gt or Lt, the" + " values array must have a single element, which will be interpreted as" + " an integer. This array is replaced during a strategic merge patch." + ) + ), + ] = None class NodeSelectorTerm(BaseModel): - match_expressions: Optional[List[NodeSelectorRequirement]] = Field( - default=None, - alias="matchExpressions", - description="A list of node selector requirements by node's labels.", - ) - match_fields: Optional[List[NodeSelectorRequirement]] = Field( - default=None, - alias="matchFields", - description="A list of node selector requirements by node's fields.", - ) - - -class ObjectFieldSelector(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=("Version of the schema the FieldPath is written in terms of, defaults to" ' "v1".'), - ) - field_path: str = Field( - ..., - alias="fieldPath", - description="Path of the field to select in the specified API version.", - ) - - -class ObjectReference(BaseModel): - api_version: Optional[str] = Field(default=None, alias="apiVersion", description="API version of the referent.") - field_path: Optional[str] = Field( - default=None, - alias="fieldPath", - description=( - "If referring to a piece of an object instead of an entire object, this" - " string should contain a valid JSON/Go field access statement, such as" - " desiredState.manifest.containers[2]. For example, if the object reference" - " is to a container within a pod, this would take on a value like:" - ' "spec.containers{name}" (where "name" refers to the name of the container' - " that triggered the event) or if no container name is specified" - ' "spec.containers[2]" (container with index 2 in this pod). This syntax is' - " chosen only to have some well-defined way of referencing a part of an" - " object." - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind of the referent. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - namespace: Optional[str] = Field( - default=None, - description=( - "Namespace of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" - ), - ) - resource_version: Optional[str] = Field( - default=None, - alias="resourceVersion", - description=( - "Specific resourceVersion to which this reference is made, if any. More" - " info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" - ), - ) - uid: Optional[str] = Field( - default=None, - description=( - "UID of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids" - ), - ) - - -class Type(Enum): - file_system_resize_pending = "FileSystemResizePending" - resizing = "Resizing" + match_expressions: Annotated[ + Optional[List[NodeSelectorRequirement]], + Field( + alias="matchExpressions", + description="A list of node selector requirements by node's labels.", + ), + ] = None + match_fields: Annotated[ + Optional[List[NodeSelectorRequirement]], + Field( + alias="matchFields", + description="A list of node selector requirements by node's fields.", + ), + ] = None class Phase(Enum): @@ -574,463 +713,366 @@ class Phase(Enum): pending = "Pending" +class TypedLocalObjectReference(BaseModel): + api_group: Annotated[ + Optional[str], + Field( + alias="apiGroup", + description=( + "APIGroup is the group for the resource being referenced. If APIGroup" + " is not specified, the specified Kind must be in the core API group." + " For any other third-party types, APIGroup is required." + ), + ), + ] = None + kind: Annotated[str, Field(description="Kind is the type of resource being referenced")] + name: Annotated[str, Field(description="Name is the name of resource being referenced")] + + class PersistentVolumeClaimVolumeSource(BaseModel): - claim_name: str = Field( - ..., - alias="claimName", - description=( - "ClaimName is the name of a PersistentVolumeClaim in the same namespace as" - " the pod using this volume. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description="Will force the ReadOnly setting in VolumeMounts. Default false.", - ) + claim_name: Annotated[ + str, + Field( + alias="claimName", + description=( + "ClaimName is the name of a PersistentVolumeClaim in the same namespace" + " as the pod using this volume. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" + ), + ), + ] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=("Will force the ReadOnly setting in VolumeMounts. Default false."), + ), + ] = None class PhotonPersistentDiskVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - pd_id: str = Field( - ..., - alias="pdID", - description="ID that identifies Photon Controller persistent disk", - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + pd_id: Annotated[ + str, + Field( + alias="pdID", + description="ID that identifies Photon Controller persistent disk", + ), + ] class PodDNSConfigOption(BaseModel): - name: Optional[str] = Field(default=None, description="Required.") + name: Annotated[Optional[str], Field(description="Required.")] = None value: Optional[str] = None -class PortworxVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "FSType represents the filesystem type to mount Must be a filesystem type" - ' supported by the host operating system. Ex. "ext4", "xfs". Implicitly' - ' inferred to be "ext4" if unspecified.' - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." - ), - ) - volume_id: str = Field( - ..., - alias="volumeID", - description="VolumeID uniquely identifies a Portworx volume", - ) - - -class PreferredSchedulingTerm(BaseModel): - preference: NodeSelectorTerm = Field( - ..., - description="A node selector term, associated with the corresponding weight.", - ) - weight: int = Field( - ..., - description=("Weight associated with matching the corresponding nodeSelectorTerm, in the" " range 1-100."), - ) - - -class QuobyteVolumeSource(BaseModel): - group: Optional[str] = Field(default=None, description="Group to map volume access to Default is no group") - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the Quobyte volume to be mounted with read-only" - " permissions. Defaults to false." - ), - ) - registry: str = Field( - ..., - description=( - "Registry represents a single or multiple Quobyte Registry services" - " specified as a string as host:port pair (multiple entries are separated" - " with commas) which acts as the central registry for volumes" - ), - ) - tenant: Optional[str] = Field( - default=None, - description=( - "Tenant owning the given Quobyte volume in the Backend Used with" - " dynamically provisioned Quobyte volumes, value is set by the plugin" - ), - ) - user: Optional[str] = Field( - default=None, - description="User to map volume access to Defaults to serivceaccount user", - ) - volume: str = Field( - ..., - description=("Volume is a string that references an already created Quobyte volume by" " name."), - ) - - -class RBDVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type of the volume that you want to mount. Tip: Ensure that the" - " filesystem type is supported by the host operating system. Examples:" - ' "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' - " More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd" - ), - ) - image: str = Field( - ..., - description=( - "The rados image name. More info:" " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - keyring: Optional[str] = Field( - default=None, - description=( - "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring." - " More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - monitors: List[str] = Field( - ..., - description=( - "A collection of Ceph monitors. More info:" " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - pool: Optional[str] = Field( - default=None, - description=( - "The rados pool name. Default is rbd. More info:" - " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to" - " false. More info:" - " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=( - "SecretRef is name of the authentication secret for RBDUser. If provided" - " overrides keyring. Default is nil. More info:" - " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - user: Optional[str] = Field( - default=None, - description=( - "The rados user name. Default is admin. More info:" - " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - - class SELinuxOptions(BaseModel): - level: Optional[str] = Field( - default=None, - description="Level is SELinux level label that applies to the container.", - ) - role: Optional[str] = Field( - default=None, - description="Role is a SELinux role label that applies to the container.", - ) - type: Optional[str] = Field( - default=None, - description="Type is a SELinux type label that applies to the container.", - ) - user: Optional[str] = Field( - default=None, - description="User is a SELinux user label that applies to the container.", - ) - - -class ScaleIOVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs".' - ), - ) - gateway: str = Field(..., description="The host address of the ScaleIO API Gateway.") - protection_domain: Optional[str] = Field( - default=None, - alias="protectionDomain", - description=("The name of the ScaleIO Protection Domain for the configured storage."), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." - ), - ) - secret_ref: LocalObjectReference = Field( - ..., - alias="secretRef", - description=( - "SecretRef references to the secret for ScaleIO user and other sensitive" - " information. If this is not provided, Login operation will fail." - ), - ) - ssl_enabled: Optional[bool] = Field( - default=None, - alias="sslEnabled", - description=("Flag to enable/disable SSL communication with Gateway, default false"), - ) - storage_mode: Optional[str] = Field( - default=None, - alias="storageMode", - description=( - "Indicates whether the storage for a volume should be ThickProvisioned or" - " ThinProvisioned. Default is ThinProvisioned." - ), - ) - storage_pool: Optional[str] = Field( - default=None, - alias="storagePool", - description="The ScaleIO Storage Pool associated with the protection domain.", - ) - system: str = Field(..., description="The name of the storage system as configured in ScaleIO.") - volume_name: Optional[str] = Field( - default=None, - alias="volumeName", - description=( - "The name of a volume already created in the ScaleIO system that is" " associated with this volume source." - ), - ) + level: Annotated[ + Optional[str], + Field(description="Level is SELinux level label that applies to the container."), + ] = None + role: Annotated[ + Optional[str], + Field(description="Role is a SELinux role label that applies to the container."), + ] = None + type: Annotated[ + Optional[str], + Field(description="Type is a SELinux type label that applies to the container."), + ] = None + user: Annotated[ + Optional[str], + Field(description="User is a SELinux user label that applies to the container."), + ] = None -class TypeModel(Enum): +class Type(Enum): localhost = "Localhost" runtime_default = "RuntimeDefault" unconfined = "Unconfined" class SeccompProfile(BaseModel): - localhost_profile: Optional[str] = Field( - default=None, - alias="localhostProfile", - description=( - "localhostProfile indicates a profile defined in a file on the node should" - " be used. The profile must be preconfigured on the node to work. Must be a" - " descending path, relative to the kubelet's configured seccomp profile" - ' location. Must only be set if type is "Localhost".' - ), - ) - type: TypeModel = Field( - ..., - description=( - "type indicates which kind of seccomp profile will be applied. Valid" - " options are:\n\nLocalhost - a profile defined in a file on the node" - " should be used. RuntimeDefault - the container runtime default profile" - " should be used. Unconfined - no profile should be applied.\n\nPossible" - ' enum values:\n - `"Localhost"` indicates a profile defined in a file on' - " the node should be used. The file's location relative to" - ' /seccomp.\n - `"RuntimeDefault"` represents the default' - ' container runtime seccomp profile.\n - `"Unconfined"` indicates no' - " seccomp profile is applied (A.K.A. unconfined)." - ), - ) + localhost_profile: Annotated[ + Optional[str], + Field( + alias="localhostProfile", + description=( + "localhostProfile indicates a profile defined in a file on the node" + " should be used. The profile must be preconfigured on the node to" + " work. Must be a descending path, relative to the kubelet's" + " configured seccomp profile location. Must only be set if type is" + ' "Localhost".' + ), + ), + ] = None + type: Annotated[ + Type, + Field( + description=( + "type indicates which kind of seccomp profile will be applied. Valid" + " options are:\n\nLocalhost - a profile defined in a file on the node" + " should be used. RuntimeDefault - the container runtime default" + " profile should be used. Unconfined - no profile should be" + ' applied.\n\nPossible enum values:\n - `"Localhost"` indicates a' + " profile defined in a file on the node should be used. The file's" + " location relative to /seccomp.\n -" + ' `"RuntimeDefault"` represents the default container runtime seccomp' + ' profile.\n - `"Unconfined"` indicates no seccomp profile is applied' + " (A.K.A. unconfined)." + ) + ), + ] -class SecretEnvSource(BaseModel): - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field(default=None, description="Specify whether the Secret must be defined") +class WindowsSecurityContextOptions(BaseModel): + gmsa_credential_spec: Annotated[ + Optional[str], + Field( + alias="gmsaCredentialSpec", + description=( + "GMSACredentialSpec is where the GMSA admission webhook" + " (https://github.com/kubernetes-sigs/windows-gmsa) inlines the" + " contents of the GMSA credential spec named by the" + " GMSACredentialSpecName field." + ), + ), + ] = None + gmsa_credential_spec_name: Annotated[ + Optional[str], + Field( + alias="gmsaCredentialSpecName", + description=("GMSACredentialSpecName is the name of the GMSA credential spec to use."), + ), + ] = None + host_process: Annotated[ + Optional[bool], + Field( + alias="hostProcess", + description=( + "HostProcess determines if a container should be run as a 'Host" + " Process' container. This field is alpha-level and will only be" + " honored by components that enable the WindowsHostProcessContainers" + " feature flag. Setting this field without the feature flag will result" + " in errors when validating the Pod. All of a Pod's containers must" + " have the same effective HostProcess value (it is not allowed to have" + " a mix of HostProcess containers and non-HostProcess containers). In" + " addition, if HostProcess is true then HostNetwork must also be set to" + " true." + ), + ), + ] = None + run_as_user_name: Annotated[ + Optional[str], + Field( + alias="runAsUserName", + description=( + "The UserName in Windows to run the entrypoint of the container" + " process. Defaults to the user specified in image metadata if" + " unspecified. May also be set in PodSecurityContext. If set in both" + " SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence." + ), + ), + ] = None -class SecretKeySelector(BaseModel): - key: str = Field( - ..., - description=("The key of the secret to select from. Must be a valid secret key."), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the Secret or its key must be defined", - ) +class PortworxVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "FSType represents the filesystem type to mount Must be a filesystem" + ' type supported by the host operating system. Ex. "ext4", "xfs".' + ' Implicitly inferred to be "ext4" if unspecified.' + ), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), + ), + ] = None + volume_id: Annotated[ + str, + Field( + alias="volumeID", + description="VolumeID uniquely identifies a Portworx volume", + ), + ] + + +class QuobyteVolumeSource(BaseModel): + group: Annotated[ + Optional[str], + Field(description="Group to map volume access to Default is no group"), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the Quobyte volume to be mounted with" + " read-only permissions. Defaults to false." + ), + ), + ] = None + registry: Annotated[ + str, + Field( + description=( + "Registry represents a single or multiple Quobyte Registry services" + " specified as a string as host:port pair (multiple entries are" + " separated with commas) which acts as the central registry for volumes" + ) + ), + ] + tenant: Annotated[ + Optional[str], + Field( + description=( + "Tenant owning the given Quobyte volume in the Backend Used with" + " dynamically provisioned Quobyte volumes, value is set by the plugin" + ) + ), + ] = None + user: Annotated[ + Optional[str], + Field(description="User to map volume access to Defaults to serivceaccount user"), + ] = None + volume: Annotated[ + str, + Field(description=("Volume is a string that references an already created Quobyte volume" " by name.")), + ] class SecretProjection(BaseModel): - items: Optional[List[KeyToPath]] = Field( - default=None, - description=( - "If unspecified, each key-value pair in the Data field of the referenced" - " Secret will be projected into the volume as a file whose name is the key" - " and content is the value. If specified, the listed keys will be projected" - " into the specified paths, and unlisted keys will not be present. If a key" - " is specified which is not present in the Secret, the volume setup will" - " error unless it is marked optional. Paths must be relative and may not" - " contain the '..' path or start with '..'." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the Secret or its key must be defined", - ) + items: Annotated[ + Optional[List[KeyToPath]], + Field( + description=( + "If unspecified, each key-value pair in the Data field of the" + " referenced Secret will be projected into the volume as a file whose" + " name is the key and content is the value. If specified, the listed" + " keys will be projected into the specified paths, and unlisted keys" + " will not be present. If a key is specified which is not present in" + " the Secret, the volume setup will error unless it is marked optional." + " Paths must be relative and may not contain the '..' path or start" + " with '..'." + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the Secret or its key must be defined"), + ] = None class SecretVolumeSource(BaseModel): - default_mode: Optional[int] = Field( - default=None, - alias="defaultMode", - description=( - "Optional: mode bits used to set permissions on created files by default." - " Must be an octal value between 0000 and 0777 or a decimal value between 0" - " and 511. YAML accepts both octal and decimal values, JSON requires" - " decimal values for mode bits. Defaults to 0644. Directories within the" - " path are not affected by this setting. This might be in conflict with" - " other options that affect the file mode, like fsGroup, and the result can" - " be other mode bits set." - ), - ) - items: Optional[List[KeyToPath]] = Field( - default=None, - description=( - "If unspecified, each key-value pair in the Data field of the referenced" - " Secret will be projected into the volume as a file whose name is the key" - " and content is the value. If specified, the listed keys will be projected" - " into the specified paths, and unlisted keys will not be present. If a key" - " is specified which is not present in the Secret, the volume setup will" - " error unless it is marked optional. Paths must be relative and may not" - " contain the '..' path or start with '..'." - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the Secret or its keys must be defined", - ) - secret_name: Optional[str] = Field( - default=None, - alias="secretName", - description=( - "Name of the secret in the pod's namespace to use. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#secret" - ), - ) + default_mode: Annotated[ + Optional[int], + Field( + alias="defaultMode", + description=( + "Optional: mode bits used to set permissions on created files by" + " default. Must be an octal value between 0000 and 0777 or a decimal" + " value between 0 and 511. YAML accepts both octal and decimal values," + " JSON requires decimal values for mode bits. Defaults to 0644." + " Directories within the path are not affected by this setting. This" + " might be in conflict with other options that affect the file mode," + " like fsGroup, and the result can be other mode bits set." + ), + ), + ] = None + items: Annotated[ + Optional[List[KeyToPath]], + Field( + description=( + "If unspecified, each key-value pair in the Data field of the" + " referenced Secret will be projected into the volume as a file whose" + " name is the key and content is the value. If specified, the listed" + " keys will be projected into the specified paths, and unlisted keys" + " will not be present. If a key is specified which is not present in" + " the Secret, the volume setup will error unless it is marked optional." + " Paths must be relative and may not contain the '..' path or start" + " with '..'." + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the Secret or its keys must be defined"), + ] = None + secret_name: Annotated[ + Optional[str], + Field( + alias="secretName", + description=( + "Name of the secret in the pod's namespace to use. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#secret" + ), + ), + ] = None class ServiceAccountTokenProjection(BaseModel): - audience: Optional[str] = Field( - default=None, - description=( - "Audience is the intended audience of the token. A recipient of a token" - " must identify itself with an identifier specified in the audience of the" - " token, and otherwise should reject the token. The audience defaults to" - " the identifier of the apiserver." - ), - ) - expiration_seconds: Optional[int] = Field( - default=None, - alias="expirationSeconds", - description=( - "ExpirationSeconds is the requested duration of validity of the service" - " account token. As the token approaches expiration, the kubelet volume" - " plugin will proactively rotate the service account token. The kubelet" - " will start trying to rotate the token if the token is older than 80" - " percent of its time to live or if the token is older than 24" - " hours.Defaults to 1 hour and must be at least 10 minutes." - ), - ) - path: str = Field( - ..., - description=("Path is the path relative to the mount point of the file to project the" " token into."), - ) - - -class StorageOSVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=( - "SecretRef specifies the secret to use for obtaining the StorageOS API" - " credentials. If not specified, default values will be attempted." - ), - ) - volume_name: Optional[str] = Field( - default=None, - alias="volumeName", - description=( - "VolumeName is the human-readable name of the StorageOS volume. Volume" - " names are only unique within a namespace." - ), - ) - volume_namespace: Optional[str] = Field( - default=None, - alias="volumeNamespace", - description=( - "VolumeNamespace specifies the scope of the volume within StorageOS. If no" - " namespace is specified then the Pod's namespace will be used. This" - " allows the Kubernetes name scoping to be mirrored within StorageOS for" - " tighter integration. Set VolumeName to any name to override the default" - ' behaviour. Set to "default" if you are not using namespaces within' - " StorageOS. Namespaces that do not pre-exist within StorageOS will be" - " created." - ), - ) + audience: Annotated[ + Optional[str], + Field( + description=( + "Audience is the intended audience of the token. A recipient of a token" + " must identify itself with an identifier specified in the audience of" + " the token, and otherwise should reject the token. The audience" + " defaults to the identifier of the apiserver." + ) + ), + ] = None + expiration_seconds: Annotated[ + Optional[int], + Field( + alias="expirationSeconds", + description=( + "ExpirationSeconds is the requested duration of validity of the service" + " account token. As the token approaches expiration, the kubelet volume" + " plugin will proactively rotate the service account token. The kubelet" + " will start trying to rotate the token if the token is older than 80" + " percent of its time to live or if the token is older than 24" + " hours.Defaults to 1 hour and must be at least 10 minutes." + ), + ), + ] = None + path: Annotated[ + str, + Field(description=("Path is the path relative to the mount point of the file to project" " the token into.")), + ] class Sysctl(BaseModel): - name: str = Field(..., description="Name of a property to set") - value: str = Field(..., description="Value of a property to set") + name: Annotated[str, Field(description="Name of a property to set")] + value: Annotated[str, Field(description="Value of a property to set")] class Effect(Enum): @@ -1045,191 +1087,171 @@ class OperatorModel(Enum): class Toleration(BaseModel): - effect: Optional[Effect] = Field( - default=None, - description=( - "Effect indicates the taint effect to match. Empty means match all taint" - " effects. When specified, allowed values are NoSchedule, PreferNoSchedule" - ' and NoExecute.\n\nPossible enum values:\n - `"NoExecute"` Evict any' - " already-running pods that do not tolerate the taint. Currently enforced" - ' by NodeController.\n - `"NoSchedule"` Do not allow new pods to schedule' - " onto the node unless they tolerate the taint, but allow all pods" - " submitted to Kubelet without going through the scheduler to start, and" - " allow all already-running pods to continue running. Enforced by the" - ' scheduler.\n - `"PreferNoSchedule"` Like TaintEffectNoSchedule, but the' - " scheduler tries not to schedule new pods onto the node, rather than" - " prohibiting new pods from scheduling onto the node entirely. Enforced by" - " the scheduler." - ), - ) - key: Optional[str] = Field( - default=None, - description=( - "Key is the taint key that the toleration applies to. Empty means match all" - " taint keys. If the key is empty, operator must be Exists; this" - " combination means to match all values and all keys." - ), - ) - operator: Optional[OperatorModel] = Field( - default=None, - description=( - "Operator represents a key's relationship to the value. Valid operators" - " are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard" - " for value, so that a pod can tolerate all taints of a particular" - ' category.\n\nPossible enum values:\n - `"Equal"`\n - `"Exists"`' - ), - ) - toleration_seconds: Optional[int] = Field( - default=None, - alias="tolerationSeconds", - description=( - "TolerationSeconds represents the period of time the toleration (which must" - " be of effect NoExecute, otherwise this field is ignored) tolerates the" - " taint. By default, it is not set, which means tolerate the taint forever" - " (do not evict). Zero and negative values will be treated as 0 (evict" - " immediately) by the system." - ), - ) - value: Optional[str] = Field( - default=None, - description=( - "Value is the taint value the toleration matches to. If the operator is" - " Exists, the value should be empty, otherwise just a regular string." - ), - ) + effect: Annotated[ + Optional[Effect], + Field( + description=( + "Effect indicates the taint effect to match. Empty means match all" + " taint effects. When specified, allowed values are NoSchedule," + " PreferNoSchedule and NoExecute.\n\nPossible enum values:\n -" + ' `"NoExecute"` Evict any already-running pods that do not tolerate the' + ' taint. Currently enforced by NodeController.\n - `"NoSchedule"` Do' + " not allow new pods to schedule onto the node unless they tolerate the" + " taint, but allow all pods submitted to Kubelet without going through" + " the scheduler to start, and allow all already-running pods to" + ' continue running. Enforced by the scheduler.\n - `"PreferNoSchedule"`' + " Like TaintEffectNoSchedule, but the scheduler tries not to schedule" + " new pods onto the node, rather than prohibiting new pods from" + " scheduling onto the node entirely. Enforced by the scheduler." + ) + ), + ] = None + key: Annotated[ + Optional[str], + Field( + description=( + "Key is the taint key that the toleration applies to. Empty means match" + " all taint keys. If the key is empty, operator must be Exists; this" + " combination means to match all values and all keys." + ) + ), + ] = None + operator: Annotated[ + Optional[OperatorModel], + Field( + description=( + "Operator represents a key's relationship to the value. Valid" + " operators are Exists and Equal. Defaults to Equal. Exists is" + " equivalent to wildcard for value, so that a pod can tolerate all" + " taints of a particular category.\n\nPossible enum values:\n -" + ' `"Equal"`\n - `"Exists"`' + ) + ), + ] = None + toleration_seconds: Annotated[ + Optional[int], + Field( + alias="tolerationSeconds", + description=( + "TolerationSeconds represents the period of time the toleration (which" + " must be of effect NoExecute, otherwise this field is ignored)" + " tolerates the taint. By default, it is not set, which means tolerate" + " the taint forever (do not evict). Zero and negative values will be" + " treated as 0 (evict immediately) by the system." + ), + ), + ] = None + value: Annotated[ + Optional[str], + Field( + description=( + "Value is the taint value the toleration matches to. If the operator is" + " Exists, the value should be empty, otherwise just a regular string." + ) + ), + ] = None -class TypedLocalObjectReference(BaseModel): - api_group: Optional[str] = Field( - default=None, - alias="apiGroup", - description=( - "APIGroup is the group for the resource being referenced. If APIGroup is" - " not specified, the specified Kind must be in the core API group. For any" - " other third-party types, APIGroup is required." - ), - ) - kind: str = Field(..., description="Kind is the type of resource being referenced") - name: str = Field(..., description="Name is the name of resource being referenced") +class VsphereVirtualDiskVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + storage_policy_id: Annotated[ + Optional[str], + Field( + alias="storagePolicyID", + description=( + "Storage Policy Based Management (SPBM) profile ID associated with the" " StoragePolicyName." + ), + ), + ] = None + storage_policy_name: Annotated[ + Optional[str], + Field( + alias="storagePolicyName", + description="Storage Policy Based Management (SPBM) profile name.", + ), + ] = None + volume_path: Annotated[ + str, + Field(alias="volumePath", description="Path that identifies vSphere volume vmdk"), + ] class VolumeDevice(BaseModel): - device_path: str = Field( - ..., - alias="devicePath", - description=("devicePath is the path inside of the container that the device will be" " mapped to."), - ) - name: str = Field( - ..., - description="name must match the name of a persistentVolumeClaim in the pod", - ) + device_path: Annotated[ + str, + Field( + alias="devicePath", + description=("devicePath is the path inside of the container that the device will be" " mapped to."), + ), + ] + name: Annotated[ + str, + Field(description="name must match the name of a persistentVolumeClaim in the pod"), + ] class VolumeMount(BaseModel): - mount_path: str = Field( - ..., - alias="mountPath", - description=("Path within the container at which the volume should be mounted. Must not" " contain ':'."), - ) - mount_propagation: Optional[str] = Field( - default=None, - alias="mountPropagation", - description=( - "mountPropagation determines how mounts are propagated from the host to" - " container and the other way around. When not set, MountPropagationNone is" - " used. This field is beta in 1.10." - ), - ) - name: str = Field(..., description="This must match the Name of a Volume.") - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=("Mounted read-only if true, read-write otherwise (false or unspecified)." " Defaults to false."), - ) - sub_path: Optional[str] = Field( - default=None, - alias="subPath", - description=( - "Path within the volume from which the container's volume should be" - ' mounted. Defaults to "" (volume\'s root).' - ), - ) - sub_path_expr: Optional[str] = Field( - default=None, - alias="subPathExpr", - description=( - "Expanded path within the volume from which the container's volume should" - " be mounted. Behaves similarly to SubPath but environment variable" - " references $(VAR_NAME) are expanded using the container's environment." - ' Defaults to "" (volume\'s root). SubPathExpr and SubPath are mutually' - " exclusive." - ), - ) - - -class VsphereVirtualDiskVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - storage_policy_id: Optional[str] = Field( - default=None, - alias="storagePolicyID", - description=("Storage Policy Based Management (SPBM) profile ID associated with the" " StoragePolicyName."), - ) - storage_policy_name: Optional[str] = Field( - default=None, - alias="storagePolicyName", - description="Storage Policy Based Management (SPBM) profile name.", - ) - volume_path: str = Field(..., alias="volumePath", description="Path that identifies vSphere volume vmdk") - - -class WindowsSecurityContextOptions(BaseModel): - gmsa_credential_spec: Optional[str] = Field( - default=None, - alias="gmsaCredentialSpec", - description=( - "GMSACredentialSpec is where the GMSA admission webhook" - " (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of" - " the GMSA credential spec named by the GMSACredentialSpecName field." - ), - ) - gmsa_credential_spec_name: Optional[str] = Field( - default=None, - alias="gmsaCredentialSpecName", - description=("GMSACredentialSpecName is the name of the GMSA credential spec to use."), - ) - host_process: Optional[bool] = Field( - default=None, - alias="hostProcess", - description=( - "HostProcess determines if a container should be run as a 'Host Process'" - " container. This field is alpha-level and will only be honored by" - " components that enable the WindowsHostProcessContainers feature flag." - " Setting this field without the feature flag will result in errors when" - " validating the Pod. All of a Pod's containers must have the same" - " effective HostProcess value (it is not allowed to have a mix of" - " HostProcess containers and non-HostProcess containers). In addition, if" - " HostProcess is true then HostNetwork must also be set to true." - ), - ) - run_as_user_name: Optional[str] = Field( - default=None, - alias="runAsUserName", - description=( - "The UserName in Windows to run the entrypoint of the container process." - " Defaults to the user specified in image metadata if unspecified. May also" - " be set in PodSecurityContext. If set in both SecurityContext and" - " PodSecurityContext, the value specified in SecurityContext takes" - " precedence." - ), - ) + mount_path: Annotated[ + str, + Field( + alias="mountPath", + description=("Path within the container at which the volume should be mounted. Must" " not contain ':'."), + ), + ] + mount_propagation: Annotated[ + Optional[str], + Field( + alias="mountPropagation", + description=( + "mountPropagation determines how mounts are propagated from the host to" + " container and the other way around. When not set," + " MountPropagationNone is used. This field is beta in 1.10." + ), + ), + ] = None + name: Annotated[str, Field(description="This must match the Name of a Volume.")] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Mounted read-only if true, read-write otherwise (false or" " unspecified). Defaults to false." + ), + ), + ] = None + sub_path: Annotated[ + Optional[str], + Field( + alias="subPath", + description=( + "Path within the volume from which the container's volume should be" + ' mounted. Defaults to "" (volume\'s root).' + ), + ), + ] = None + sub_path_expr: Annotated[ + Optional[str], + Field( + alias="subPathExpr", + description=( + "Expanded path within the volume from which the container's volume" + " should be mounted. Behaves similarly to SubPath but environment" + " variable references $(VAR_NAME) are expanded using the container's" + ' environment. Defaults to "" (volume\'s root). SubPathExpr and SubPath' + " are mutually exclusive." + ), + ), + ] = None class ImagePullPolicy(Enum): @@ -1238,1995 +1260,2683 @@ class ImagePullPolicy(Enum): if_not_present = "IfNotPresent" +class TypeModel(Enum): + file_system_resize_pending = "FileSystemResizePending" + resizing = "Resizing" + + +class PersistentVolumeClaimCondition(BaseModel): + last_probe_time: Annotated[ + Optional[v1.Time], + Field(alias="lastProbeTime", description="Last time we probed the condition."), + ] = None + last_transition_time: Annotated[ + Optional[v1.Time], + Field( + alias="lastTransitionTime", + description=("Last time the condition transitioned from one status to another."), + ), + ] = None + message: Annotated[ + Optional[str], + Field(description=("Human-readable message indicating details about last transition.")), + ] = None + reason: Annotated[ + Optional[str], + Field( + description=( + "Unique, this should be a short, machine understandable string that" + " gives the reason for condition's last transition. If it reports" + ' "ResizeStarted" that means the underlying persistent volume is being' + " resized." + ) + ), + ] = None + status: str + type: Annotated[ + TypeModel, + Field( + description=( + '\n\n\nPossible enum values:\n - `"FileSystemResizePending"` -' + " controller resize is finished and a file system resize is pending on" + ' node\n - `"Resizing"` - a user trigger resize of pvc has been started' + ) + ), + ] + + +class ServicePort(BaseModel): + app_protocol: Annotated[ + Optional[str], + Field( + alias="appProtocol", + description=( + "The application protocol for this port. This field follows standard" + " Kubernetes label syntax. Un-prefixed names are reserved for IANA" + " standard service names (as per RFC-6335 and" + " http://www.iana.org/assignments/service-names). Non-standard" + " protocols should use prefixed names such as" + " mycompany.com/my-custom-protocol." + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "The name of this port within the service. This must be a DNS_LABEL." + " All ports within a ServiceSpec must have unique names. When" + " considering the endpoints for a Service, this must match the 'name'" + " field in the EndpointPort. Optional if only one ServicePort is" + " defined on this service." + ) + ), + ] = None + node_port: Annotated[ + Optional[int], + Field( + alias="nodePort", + description=( + "The port on each node on which this service is exposed when type is" + " NodePort or LoadBalancer. Usually assigned by the system. If a value" + " is specified, in-range, and not in use it will be used, otherwise the" + " operation will fail. If not specified, a port will be allocated if" + " this Service requires one. If this field is specified when creating" + " a Service which does not need it, creation will fail. This field will" + " be wiped when updating a Service to no longer need it (e.g. changing" + " type from NodePort to ClusterIP). More info:" + " https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" + ), + ), + ] = None + port: Annotated[int, Field(description="The port that will be exposed by this service.")] + protocol: Annotated[ + Optional[Protocol], + Field( + description=( + 'The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".' + ' Default is TCP.\n\nPossible enum values:\n - `"SCTP"` is the SCTP' + ' protocol.\n - `"TCP"` is the TCP protocol.\n - `"UDP"` is the UDP' + " protocol." + ) + ), + ] = None + target_port: Annotated[ + Optional[intstr.IntOrString], + Field( + alias="targetPort", + description=( + "Number or name of the port to access on the pods targeted by the" + " service. Number must be in the range 1 to 65535. Name must be an" + " IANA_SVC_NAME. If this is a string, it will be looked up as a named" + " port in the target Pod's container ports. If this is not specified," + " the value of the 'port' field is used (an identity map). This field" + " is ignored for services with clusterIP=None, and should be omitted or" + " set equal to the 'port' field. More info:" + " https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service" + ), + ), + ] = None + + +class TCPSocketAction(BaseModel): + host: Annotated[ + Optional[str], + Field(description="Optional: Host name to connect to, defaults to the pod IP."), + ] = None + port: Annotated[ + intstr.IntOrString, + Field( + description=( + "Number or name of the port to access on the container. Number must be" + " in the range 1 to 65535. Name must be an IANA_SVC_NAME." + ) + ), + ] + + class CSIVolumeSource(BaseModel): - driver: str = Field( - ..., - description=( - "Driver is the name of the CSI driver that handles this volume. Consult" - " with your admin for the correct name as registered in the cluster." - ), - ) - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - 'Filesystem type to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the' - " empty value is passed to the associated CSI driver which will determine" - " the default filesystem to apply." - ), - ) - node_publish_secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="nodePublishSecretRef", - description=( - "NodePublishSecretRef is a reference to the secret object containing" - " sensitive information to pass to the CSI driver to complete the CSI" - " NodePublishVolume and NodeUnpublishVolume calls. This field is optional," - " and may be empty if no secret is required. If the secret object contains" - " more than one secret, all secret references are passed." - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=("Specifies a read-only configuration for the volume. Defaults to false" " (read/write)."), - ) - volume_attributes: Optional[Dict[str, str]] = Field( - default=None, - alias="volumeAttributes", - description=( - "VolumeAttributes stores driver-specific properties that are passed to the" - " CSI driver. Consult your driver's documentation for supported values." - ), - ) + driver: Annotated[ + str, + Field( + description=( + "Driver is the name of the CSI driver that handles this volume. Consult" + " with your admin for the correct name as registered in the cluster." + ) + ), + ] + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + 'Filesystem type to mount. Ex. "ext4", "xfs", "ntfs". If not provided,' + " the empty value is passed to the associated CSI driver which will" + " determine the default filesystem to apply." + ), + ), + ] = None + node_publish_secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="nodePublishSecretRef", + description=( + "NodePublishSecretRef is a reference to the secret object containing" + " sensitive information to pass to the CSI driver to complete the CSI" + " NodePublishVolume and NodeUnpublishVolume calls. This field is" + " optional, and may be empty if no secret is required. If the secret" + " object contains more than one secret, all secret references are" + " passed." + ), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=("Specifies a read-only configuration for the volume. Defaults to false" " (read/write)."), + ), + ] = None + volume_attributes: Annotated[ + Optional[Dict[str, str]], + Field( + alias="volumeAttributes", + description=( + "VolumeAttributes stores driver-specific properties that are passed to" + " the CSI driver. Consult your driver's documentation for supported" + " values." + ), + ), + ] = None class CephFSVolumeSource(BaseModel): - monitors: List[str] = Field( - ..., - description=( - "Required: Monitors is a collection of Ceph monitors More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) - path: Optional[str] = Field( - default=None, - description=("Optional: Used as the mounted root, rather than the full Ceph tree," " default is /"), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Optional: Defaults to false (read/write). ReadOnly here will force the" - " ReadOnly setting in VolumeMounts. More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) - secret_file: Optional[str] = Field( - default=None, - alias="secretFile", - description=( - "Optional: SecretFile is the path to key ring for User, default is" - " /etc/ceph/user.secret More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=( - "Optional: SecretRef is reference to the authentication secret for User," - " default is empty. More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) - user: Optional[str] = Field( - default=None, - description=( - "Optional: User is the rados user name, default is admin More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) + monitors: Annotated[ + List[str], + Field( + description=( + "Required: Monitors is a collection of Ceph monitors More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ) + ), + ] + path: Annotated[ + Optional[str], + Field(description=("Optional: Used as the mounted root, rather than the full Ceph tree," " default is /")), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Optional: Defaults to false (read/write). ReadOnly here will force the" + " ReadOnly setting in VolumeMounts. More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ), + ), + ] = None + secret_file: Annotated[ + Optional[str], + Field( + alias="secretFile", + description=( + "Optional: SecretFile is the path to key ring for User, default is" + " /etc/ceph/user.secret More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=( + "Optional: SecretRef is reference to the authentication secret for" + " User, default is empty. More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ), + ), + ] = None + user: Annotated[ + Optional[str], + Field( + description=( + "Optional: User is the rados user name, default is admin More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ) + ), + ] = None class CinderVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to' - ' be "ext4" if unspecified. More info:' - " https://examples.k8s.io/mysql-cinder-pd/README.md" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Optional: Defaults to false (read/write). ReadOnly here will force the" - " ReadOnly setting in VolumeMounts. More info:" - " https://examples.k8s.io/mysql-cinder-pd/README.md" - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=("Optional: points to a secret object containing parameters used to connect" " to OpenStack."), - ) - volume_id: str = Field( - ..., - alias="volumeID", - description=( - "volume id used to identify the volume in cinder. More info:" - " https://examples.k8s.io/mysql-cinder-pd/README.md" - ), - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly' + ' inferred to be "ext4" if unspecified. More info:' + " https://examples.k8s.io/mysql-cinder-pd/README.md" + ), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Optional: Defaults to false (read/write). ReadOnly here will force the" + " ReadOnly setting in VolumeMounts. More info:" + " https://examples.k8s.io/mysql-cinder-pd/README.md" + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=("Optional: points to a secret object containing parameters used to" " connect to OpenStack."), + ), + ] = None + volume_id: Annotated[ + str, + Field( + alias="volumeID", + description=( + "volume id used to identify the volume in cinder. More info:" + " https://examples.k8s.io/mysql-cinder-pd/README.md" + ), + ), + ] -class ConfigMapProjection(BaseModel): - items: Optional[List[KeyToPath]] = Field( - default=None, - description=( - "If unspecified, each key-value pair in the Data field of the referenced" - " ConfigMap will be projected into the volume as a file whose name is the" - " key and content is the value. If specified, the listed keys will be" - " projected into the specified paths, and unlisted keys will not be" - " present. If a key is specified which is not present in the ConfigMap, the" - " volume setup will error unless it is marked optional. Paths must be" - " relative and may not contain the '..' path or start with '..'." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the ConfigMap or its keys must be defined", - ) +class FlexVolumeSource(BaseModel): + driver: Annotated[ + str, + Field(description="Driver is the name of the driver to use for this volume."), + ] + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". The default' + " filesystem depends on FlexVolume script." + ), + ), + ] = None + options: Annotated[ + Optional[Dict[str, str]], + Field(description="Optional: Extra command options if any."), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Optional: Defaults to false (read/write). ReadOnly here will force the" + " ReadOnly setting in VolumeMounts." + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=( + "Optional: SecretRef is reference to the secret object containing" + " sensitive information to pass to the plugin scripts. This may be" + " empty if no secret object is specified. If the secret object contains" + " more than one secret, all secrets are passed to the plugin scripts." + ), + ), + ] = None -class ConfigMapVolumeSource(BaseModel): - default_mode: Optional[int] = Field( - default=None, - alias="defaultMode", - description=( - "Optional: mode bits used to set permissions on created files by default." - " Must be an octal value between 0000 and 0777 or a decimal value between 0" - " and 511. YAML accepts both octal and decimal values, JSON requires" - " decimal values for mode bits. Defaults to 0644. Directories within the" - " path are not affected by this setting. This might be in conflict with" - " other options that affect the file mode, like fsGroup, and the result can" - " be other mode bits set." - ), - ) - items: Optional[List[KeyToPath]] = Field( - default=None, - description=( - "If unspecified, each key-value pair in the Data field of the referenced" - " ConfigMap will be projected into the volume as a file whose name is the" - " key and content is the value. If specified, the listed keys will be" - " projected into the specified paths, and unlisted keys will not be" - " present. If a key is specified which is not present in the ConfigMap, the" - " volume setup will error unless it is marked optional. Paths must be" - " relative and may not contain the '..' path or start with '..'." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the ConfigMap or its keys must be defined", - ) +class ISCSIVolumeSource(BaseModel): + chap_auth_discovery: Annotated[ + Optional[bool], + Field( + alias="chapAuthDiscovery", + description="whether support iSCSI Discovery CHAP authentication", + ), + ] = None + chap_auth_session: Annotated[ + Optional[bool], + Field( + alias="chapAuthSession", + description="whether support iSCSI Session CHAP authentication", + ), + ] = None + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type of the volume that you want to mount. Tip: Ensure that" + " the filesystem type is supported by the host operating system." + ' Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if' + " unspecified. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#iscsi" + ), + ), + ] = None + initiator_name: Annotated[ + Optional[str], + Field( + alias="initiatorName", + description=( + "Custom iSCSI Initiator Name. If initiatorName is specified with" + " iscsiInterface simultaneously, new iSCSI interface : will be created for the connection." + ), + ), + ] = None + iqn: Annotated[str, Field(description="Target iSCSI Qualified Name.")] + iscsi_interface: Annotated[ + Optional[str], + Field( + alias="iscsiInterface", + description=("iSCSI Interface Name that uses an iSCSI transport. Defaults to" " 'default' (tcp)."), + ), + ] = None + lun: Annotated[int, Field(description="iSCSI Target Lun number.")] + portals: Annotated[ + Optional[List[str]], + Field( + description=( + "iSCSI Target Portal List. The portal is either an IP or ip_addr:port" + " if the port is other than default (typically TCP ports 860 and 3260)." + ) + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=("ReadOnly here will force the ReadOnly setting in VolumeMounts." " Defaults to false."), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description="CHAP Secret for iSCSI target and initiator authentication", + ), + ] = None + target_portal: Annotated[ + str, + Field( + alias="targetPortal", + description=( + "iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the" + " port is other than default (typically TCP ports 860 and 3260)." + ), + ), + ] -class EmptyDirVolumeSource(BaseModel): - medium: Optional[str] = Field( - default=None, - description=( - 'What type of storage medium should back this directory. The default is ""' - " which means to use the node's default medium. Must be an empty string" - " (default) or Memory. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#emptydir" - ), - ) - size_limit: Optional[resource.Quantity] = Field( - default=None, - alias="sizeLimit", - description=( - "Total amount of local storage required for this EmptyDir volume. The size" - " limit is also applicable for memory medium. The maximum usage on memory" - " medium EmptyDir would be the minimum value between the SizeLimit" - " specified here and the sum of memory limits of all containers in a pod." - " The default is nil which means that the limit is undefined. More info:" - " http://kubernetes.io/docs/user-guide/volumes#emptydir" - ), - ) +class RBDVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type of the volume that you want to mount. Tip: Ensure that" + " the filesystem type is supported by the host operating system." + ' Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if' + " unspecified. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#rbd" + ), + ), + ] = None + image: Annotated[ + str, + Field( + description=( + "The rados image name. More info:" " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] + keyring: Annotated[ + Optional[str], + Field( + description=( + "Keyring is the path to key ring for RBDUser. Default is" + " /etc/ceph/keyring. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] = None + monitors: Annotated[ + List[str], + Field( + description=( + "A collection of Ceph monitors. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] + pool: Annotated[ + Optional[str], + Field( + description=( + "The rados pool name. Default is rbd. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the ReadOnly setting in VolumeMounts." + " Defaults to false. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=( + "SecretRef is name of the authentication secret for RBDUser. If" + " provided overrides keyring. Default is nil. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ), + ), + ] = None + user: Annotated[ + Optional[str], + Field( + description=( + "The rados user name. Default is admin. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] = None -class EnvFromSource(BaseModel): - config_map_ref: Optional[ConfigMapEnvSource] = Field( - default=None, alias="configMapRef", description="The ConfigMap to select from" - ) - prefix: Optional[str] = Field( - default=None, - description=("An optional identifier to prepend to each key in the ConfigMap. Must be a" " C_IDENTIFIER."), - ) - secret_ref: Optional[SecretEnvSource] = Field( - default=None, alias="secretRef", description="The Secret to select from" - ) +class ScaleIOVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs".' + ), + ), + ] = None + gateway: Annotated[str, Field(description="The host address of the ScaleIO API Gateway.")] + protection_domain: Annotated[ + Optional[str], + Field( + alias="protectionDomain", + description=("The name of the ScaleIO Protection Domain for the configured storage."), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), + ), + ] = None + secret_ref: Annotated[ + LocalObjectReference, + Field( + alias="secretRef", + description=( + "SecretRef references to the secret for ScaleIO user and other" + " sensitive information. If this is not provided, Login operation will" + " fail." + ), + ), + ] + ssl_enabled: Annotated[ + Optional[bool], + Field( + alias="sslEnabled", + description=("Flag to enable/disable SSL communication with Gateway, default false"), + ), + ] = None + storage_mode: Annotated[ + Optional[str], + Field( + alias="storageMode", + description=( + "Indicates whether the storage for a volume should be ThickProvisioned" + " or ThinProvisioned. Default is ThinProvisioned." + ), + ), + ] = None + storage_pool: Annotated[ + Optional[str], + Field( + alias="storagePool", + description=("The ScaleIO Storage Pool associated with the protection domain."), + ), + ] = None + system: Annotated[ + str, + Field(description="The name of the storage system as configured in ScaleIO."), + ] + volume_name: Annotated[ + Optional[str], + Field( + alias="volumeName", + description=( + "The name of a volume already created in the ScaleIO system that is" + " associated with this volume source." + ), + ), + ] = None -class EventSeries(BaseModel): - count: Optional[int] = Field( - default=None, - description=("Number of occurrences in this series up to the last heartbeat time"), - ) - last_observed_time: Optional[v1.MicroTime] = Field( - default=None, - alias="lastObservedTime", - description="Time of the last occurrence observed", - ) +class StorageOSVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=( + "SecretRef specifies the secret to use for obtaining the StorageOS API" + " credentials. If not specified, default values will be attempted." + ), + ), + ] = None + volume_name: Annotated[ + Optional[str], + Field( + alias="volumeName", + description=( + "VolumeName is the human-readable name of the StorageOS volume. Volume" + " names are only unique within a namespace." + ), + ), + ] = None + volume_namespace: Annotated[ + Optional[str], + Field( + alias="volumeNamespace", + description=( + "VolumeNamespace specifies the scope of the volume within StorageOS. " + " If no namespace is specified then the Pod's namespace will be used. " + " This allows the Kubernetes name scoping to be mirrored within" + " StorageOS for tighter integration. Set VolumeName to any name to" + ' override the default behaviour. Set to "default" if you are not using' + " namespaces within StorageOS. Namespaces that do not pre-exist within" + " StorageOS will be created." + ), + ), + ] = None -class FlexVolumeSource(BaseModel): - driver: str = Field(..., description="Driver is the name of the driver to use for this volume.") - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem' - " depends on FlexVolume script." - ), - ) - options: Optional[Dict[str, str]] = Field(default=None, description="Optional: Extra command options if any.") - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Optional: Defaults to false (read/write). ReadOnly here will force the" - " ReadOnly setting in VolumeMounts." - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=( - "Optional: SecretRef is reference to the secret object containing sensitive" - " information to pass to the plugin scripts. This may be empty if no secret" - " object is specified. If the secret object contains more than one secret," - " all secrets are passed to the plugin scripts." - ), - ) +class EmptyDirVolumeSource(BaseModel): + medium: Annotated[ + Optional[str], + Field( + description=( + "What type of storage medium should back this directory. The default is" + ' "" which means to use the node\'s default medium. Must be an empty' + " string (default) or Memory. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#emptydir" + ) + ), + ] = None + size_limit: Annotated[ + Optional[resource.Quantity], + Field( + alias="sizeLimit", + description=( + "Total amount of local storage required for this EmptyDir volume. The" + " size limit is also applicable for memory medium. The maximum usage on" + " memory medium EmptyDir would be the minimum value between the" + " SizeLimit specified here and the sum of memory limits of all" + " containers in a pod. The default is nil which means that the limit is" + " undefined. More info:" + " http://kubernetes.io/docs/user-guide/volumes#emptydir" + ), + ), + ] = None -class HTTPGetAction(BaseModel): - host: Optional[str] = Field( - default=None, - description=( - "Host name to connect to, defaults to the pod IP. You probably want to set" - ' "Host" in httpHeaders instead.' - ), - ) - http_headers: Optional[List[HTTPHeader]] = Field( - default=None, - alias="httpHeaders", - description=("Custom headers to set in the request. HTTP allows repeated headers."), - ) - path: Optional[str] = Field(default=None, description="Path to access on the HTTP server.") - port: int = Field( - ..., - description=( - "Name or number of the port to access on the container. Number must be in" - " the range 1 to 65535. Name must be an IANA_SVC_NAME." - ), - ) - scheme: Optional[Scheme] = Field( - default=None, - description=( - "Scheme to use for connecting to the host. Defaults to HTTP.\n\nPossible" - ' enum values:\n - `"HTTP"` means that the scheme used will be http://\n -' - ' `"HTTPS"` means that the scheme used will be https://' - ), - ) +class ResourceFieldSelector(BaseModel): + container_name: Annotated[ + Optional[str], + Field( + alias="containerName", + description="Container name: required for volumes, optional for env vars", + ), + ] = None + divisor: Annotated[ + Optional[resource.Quantity], + Field(description=('Specifies the output format of the exposed resources, defaults to "1"')), + ] = None + resource: Annotated[str, Field(description="Required: resource to select")] -class ISCSIVolumeSource(BaseModel): - chap_auth_discovery: Optional[bool] = Field( - default=None, - alias="chapAuthDiscovery", - description="whether support iSCSI Discovery CHAP authentication", - ) - chap_auth_session: Optional[bool] = Field( - default=None, - alias="chapAuthSession", - description="whether support iSCSI Session CHAP authentication", - ) - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type of the volume that you want to mount. Tip: Ensure that the" - " filesystem type is supported by the host operating system. Examples:" - ' "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' - " More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi" - ), - ) - initiator_name: Optional[str] = Field( - default=None, - alias="initiatorName", - description=( - "Custom iSCSI Initiator Name. If initiatorName is specified with" - " iscsiInterface simultaneously, new iSCSI interface : will be created for the connection." - ), - ) - iqn: str = Field(..., description="Target iSCSI Qualified Name.") - iscsi_interface: Optional[str] = Field( - default=None, - alias="iscsiInterface", - description=("iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default'" " (tcp)."), - ) - lun: int = Field(..., description="iSCSI Target Lun number.") - portals: Optional[List[str]] = Field( - default=None, - description=( - "iSCSI Target Portal List. The portal is either an IP or ip_addr:port if" - " the port is other than default (typically TCP ports 860 and 3260)." - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=("ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to" " false."), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description="CHAP Secret for iSCSI target and initiator authentication", - ) - target_portal: str = Field( - ..., - alias="targetPortal", - description=( - "iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the" - " port is other than default (typically TCP ports 860 and 3260)." - ), - ) +class EnvFromSource(BaseModel): + config_map_ref: Annotated[ + Optional[ConfigMapEnvSource], + Field(alias="configMapRef", description="The ConfigMap to select from"), + ] = None + prefix: Annotated[ + Optional[str], + Field( + description=("An optional identifier to prepend to each key in the ConfigMap. Must" " be a C_IDENTIFIER.") + ), + ] = None + secret_ref: Annotated[ + Optional[SecretEnvSource], + Field(alias="secretRef", description="The Secret to select from"), + ] = None -class NodeSelector(BaseModel): - node_selector_terms: List[NodeSelectorTerm] = Field( - ..., - alias="nodeSelectorTerms", - description="Required. A list of node selector terms. The terms are ORed.", - ) +class EventSeries(BaseModel): + count: Annotated[ + Optional[int], + Field(description=("Number of occurrences in this series up to the last heartbeat time")), + ] = None + last_observed_time: Annotated[ + Optional[v1.MicroTime], + Field(alias="lastObservedTime", description="Time of the last occurrence observed"), + ] = None -class PersistentVolumeClaimCondition(BaseModel): - last_probe_time: Optional[v1.Time] = Field( - default=None, - alias="lastProbeTime", - description="Last time we probed the condition.", - ) - last_transition_time: Optional[v1.Time] = Field( - default=None, - alias="lastTransitionTime", - description="Last time the condition transitioned from one status to another.", - ) - message: Optional[str] = Field( - default=None, - description="Human-readable message indicating details about last transition.", - ) - reason: Optional[str] = Field( - default=None, - description=( - "Unique, this should be a short, machine understandable string that gives" - " the reason for condition's last transition. If it reports" - ' "ResizeStarted" that means the underlying persistent volume is being' - " resized." - ), - ) - status: str - type: Type = Field( - ..., - description=( - '\n\n\nPossible enum values:\n - `"FileSystemResizePending"` - controller' - " resize is finished and a file system resize is pending on node\n -" - ' `"Resizing"` - a user trigger resize of pvc has been started' +class PreferredSchedulingTerm(BaseModel): + preference: Annotated[ + NodeSelectorTerm, + Field(description=("A node selector term, associated with the corresponding weight.")), + ] + weight: Annotated[ + int, + Field( + description=("Weight associated with matching the corresponding nodeSelectorTerm, in" " the range 1-100.") ), - ) + ] -class PersistentVolumeClaimStatus(BaseModel): - access_modes: Optional[List[str]] = Field( - default=None, - alias="accessModes", - description=( - "AccessModes contains the actual access modes the volume backing the PVC" - " has. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1" - ), - ) - allocated_resources: Optional[Dict[str, resource.Quantity]] = Field( - default=None, - alias="allocatedResources", - description=( - "The storage resource within AllocatedResources tracks the capacity" - " allocated to a PVC. It may be larger than the actual capacity when a" - " volume expansion operation is requested. For storage quota, the larger" - " value from allocatedResources and PVC.spec.resources is used. If" - " allocatedResources is not set, PVC.spec.resources alone is used for quota" - " calculation. If a volume expansion capacity request is lowered," - " allocatedResources is only lowered if there are no expansion operations" - " in progress and if the actual volume capacity is equal or lower than the" - " requested capacity. This is an alpha field and requires enabling" - " RecoverVolumeExpansionFailure feature." - ), - ) - capacity: Optional[Dict[str, resource.Quantity]] = Field( - default=None, - description="Represents the actual resources of the underlying volume.", - ) - conditions: Optional[List[PersistentVolumeClaimCondition]] = Field( - default=None, - description=( - "Current Condition of persistent volume claim. If underlying persistent" - " volume is being resized then the Condition will be set to" - " 'ResizeStarted'." - ), - ) - phase: Optional[Phase] = Field( - default=None, - description=( - "Phase represents the current phase of PersistentVolumeClaim.\n\nPossible" - ' enum values:\n - `"Bound"` used for PersistentVolumeClaims that are' - ' bound\n - `"Lost"` used for PersistentVolumeClaims that lost their' - " underlying PersistentVolume. The claim was bound to a PersistentVolume" - " and this volume does not exist any longer and all data on it was lost.\n" - ' - `"Pending"` used for PersistentVolumeClaims that are not yet bound' - ), - ) - resize_status: Optional[str] = Field( - default=None, - alias="resizeStatus", - description=( - "ResizeStatus stores status of resize operation. ResizeStatus is not set by" - " default but when expansion is complete resizeStatus is set to empty" - " string by resize controller or kubelet. This is an alpha field and" - " requires enabling RecoverVolumeExpansionFailure feature." - ), - ) +class PodSecurityContext(BaseModel): + fs_group: Annotated[ + Optional[int], + Field( + alias="fsGroup", + description=( + "A special supplemental group that applies to all containers in a pod." + " Some volume types allow the Kubelet to change the ownership of that" + " volume to be owned by the pod:\n\n1. The owning GID will be the" + " FSGroup 2. The setgid bit is set (new files created in the volume" + " will be owned by FSGroup) 3. The permission bits are OR'd with" + " rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and" + " permissions of any volume. Note that this field cannot be set when" + " spec.os.name is windows." + ), + ), + ] = None + fs_group_change_policy: Annotated[ + Optional[str], + Field( + alias="fsGroupChangePolicy", + description=( + "fsGroupChangePolicy defines behavior of changing ownership and" + " permission of the volume before being exposed inside Pod. This field" + " will only apply to volume types which support fsGroup based" + " ownership(and permissions). It will have no effect on ephemeral" + " volume types such as: secret, configmaps and emptydir. Valid values" + ' are "OnRootMismatch" and "Always". If not specified, "Always" is' + " used. Note that this field cannot be set when spec.os.name is" + " windows." + ), + ), + ] = None + run_as_group: Annotated[ + Optional[int], + Field( + alias="runAsGroup", + description=( + "The GID to run the entrypoint of the container process. Uses runtime" + " default if unset. May also be set in SecurityContext. If set in both" + " SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence for that container. Note that this" + " field cannot be set when spec.os.name is windows." + ), + ), + ] = None + run_as_non_root: Annotated[ + Optional[bool], + Field( + alias="runAsNonRoot", + description=( + "Indicates that the container must run as a non-root user. If true, the" + " Kubelet will validate the image at runtime to ensure that it does not" + " run as UID 0 (root) and fail to start the container if it does. If" + " unset or false, no such validation will be performed. May also be set" + " in SecurityContext. If set in both SecurityContext and" + " PodSecurityContext, the value specified in SecurityContext takes" + " precedence." + ), + ), + ] = None + run_as_user: Annotated[ + Optional[int], + Field( + alias="runAsUser", + description=( + "The UID to run the entrypoint of the container process. Defaults to" + " user specified in image metadata if unspecified. May also be set in" + " SecurityContext. If set in both SecurityContext and" + " PodSecurityContext, the value specified in SecurityContext takes" + " precedence for that container. Note that this field cannot be set" + " when spec.os.name is windows." + ), + ), + ] = None + se_linux_options: Annotated[ + Optional[SELinuxOptions], + Field( + alias="seLinuxOptions", + description=( + "The SELinux context to be applied to all containers. If unspecified," + " the container runtime will allocate a random SELinux context for each" + " container. May also be set in SecurityContext. If set in both" + " SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence for that container. Note that this" + " field cannot be set when spec.os.name is windows." + ), + ), + ] = None + seccomp_profile: Annotated[ + Optional[SeccompProfile], + Field( + alias="seccompProfile", + description=( + "The seccomp options to use by the containers in this pod. Note that" + " this field cannot be set when spec.os.name is windows." + ), + ), + ] = None + supplemental_groups: Annotated[ + Optional[List[int]], + Field( + alias="supplementalGroups", + description=( + "A list of groups applied to the first process run in each container," + " in addition to the container's primary GID. If unspecified, no" + " groups will be added to any container. Note that this field cannot be" + " set when spec.os.name is windows." + ), + ), + ] = None + sysctls: Annotated[ + Optional[List[Sysctl]], + Field( + description=( + "Sysctls hold a list of namespaced sysctls used for the pod. Pods with" + " unsupported sysctls (by the container runtime) might fail to launch." + " Note that this field cannot be set when spec.os.name is windows." + ) + ), + ] = None + windows_options: Annotated[ + Optional[WindowsSecurityContextOptions], + Field( + alias="windowsOptions", + description=( + "The Windows specific settings applied to all containers. If" + " unspecified, the options within a container's SecurityContext will be" + " used. If set in both SecurityContext and PodSecurityContext, the" + " value specified in SecurityContext takes precedence. Note that this" + " field cannot be set when spec.os.name is linux." + ), + ), + ] = None -class PodDNSConfig(BaseModel): - nameservers: Optional[List[str]] = Field( - default=None, - description=( - "A list of DNS name server IP addresses. This will be appended to the base" - " nameservers generated from DNSPolicy. Duplicated nameservers will be" - " removed." - ), - ) - options: Optional[List[PodDNSConfigOption]] = Field( - default=None, - description=( - "A list of DNS resolver options. This will be merged with the base options" - " generated from DNSPolicy. Duplicated entries will be removed. Resolution" - " options given in Options will override those that appear in the base" - " DNSPolicy." - ), - ) - searches: Optional[List[str]] = Field( - default=None, - description=( - "A list of DNS search domains for host-name lookup. This will be appended" - " to the base search paths generated from DNSPolicy. Duplicated search" - " paths will be removed." - ), - ) +class SecurityContext(BaseModel): + allow_privilege_escalation: Annotated[ + Optional[bool], + Field( + alias="allowPrivilegeEscalation", + description=( + "AllowPrivilegeEscalation controls whether a process can gain more" + " privileges than its parent process. This bool directly controls if" + " the no_new_privs flag will be set on the container process." + " AllowPrivilegeEscalation is true always when the container is: 1) run" + " as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set" + " when spec.os.name is windows." + ), + ), + ] = None + capabilities: Annotated[ + Optional[Capabilities], + Field( + description=( + "The capabilities to add/drop when running containers. Defaults to the" + " default set of capabilities granted by the container runtime. Note" + " that this field cannot be set when spec.os.name is windows." + ) + ), + ] = None + privileged: Annotated[ + Optional[bool], + Field( + description=( + "Run container in privileged mode. Processes in privileged containers" + " are essentially equivalent to root on the host. Defaults to false." + " Note that this field cannot be set when spec.os.name is windows." + ) + ), + ] = None + proc_mount: Annotated[ + Optional[str], + Field( + alias="procMount", + description=( + "procMount denotes the type of proc mount to use for the containers." + " The default is DefaultProcMount which uses the container runtime" + " defaults for readonly paths and masked paths. This requires the" + " ProcMountType feature flag to be enabled. Note that this field cannot" + " be set when spec.os.name is windows." + ), + ), + ] = None + read_only_root_filesystem: Annotated[ + Optional[bool], + Field( + alias="readOnlyRootFilesystem", + description=( + "Whether this container has a read-only root filesystem. Default is" + " false. Note that this field cannot be set when spec.os.name is" + " windows." + ), + ), + ] = None + run_as_group: Annotated[ + Optional[int], + Field( + alias="runAsGroup", + description=( + "The GID to run the entrypoint of the container process. Uses runtime" + " default if unset. May also be set in PodSecurityContext. If set in" + " both SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence. Note that this field cannot be set" + " when spec.os.name is windows." + ), + ), + ] = None + run_as_non_root: Annotated[ + Optional[bool], + Field( + alias="runAsNonRoot", + description=( + "Indicates that the container must run as a non-root user. If true, the" + " Kubelet will validate the image at runtime to ensure that it does not" + " run as UID 0 (root) and fail to start the container if it does. If" + " unset or false, no such validation will be performed. May also be set" + " in PodSecurityContext. If set in both SecurityContext and" + " PodSecurityContext, the value specified in SecurityContext takes" + " precedence." + ), + ), + ] = None + run_as_user: Annotated[ + Optional[int], + Field( + alias="runAsUser", + description=( + "The UID to run the entrypoint of the container process. Defaults to" + " user specified in image metadata if unspecified. May also be set in" + " PodSecurityContext. If set in both SecurityContext and" + " PodSecurityContext, the value specified in SecurityContext takes" + " precedence. Note that this field cannot be set when spec.os.name is" + " windows." + ), + ), + ] = None + se_linux_options: Annotated[ + Optional[SELinuxOptions], + Field( + alias="seLinuxOptions", + description=( + "The SELinux context to be applied to the container. If unspecified," + " the container runtime will allocate a random SELinux context for each" + " container. May also be set in PodSecurityContext. If set in both" + " SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence. Note that this field cannot be set" + " when spec.os.name is windows." + ), + ), + ] = None + seccomp_profile: Annotated[ + Optional[SeccompProfile], + Field( + alias="seccompProfile", + description=( + "The seccomp options to use by this container. If seccomp options are" + " provided at both the pod & container level, the container options" + " override the pod options. Note that this field cannot be set when" + " spec.os.name is windows." + ), + ), + ] = None + windows_options: Annotated[ + Optional[WindowsSecurityContextOptions], + Field( + alias="windowsOptions", + description=( + "The Windows specific settings applied to all containers. If" + " unspecified, the options from the PodSecurityContext will be used. If" + " set in both SecurityContext and PodSecurityContext, the value" + " specified in SecurityContext takes precedence. Note that this field" + " cannot be set when spec.os.name is linux." + ), + ), + ] = None -class PodSecurityContext(BaseModel): - fs_group: Optional[int] = Field( - default=None, - alias="fsGroup", - description=( - "A special supplemental group that applies to all containers in a pod. Some" - " volume types allow the Kubelet to change the ownership of that volume to" - " be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The" - " setgid bit is set (new files created in the volume will be owned by" - " FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the" - " Kubelet will not modify the ownership and permissions of any volume. Note" - " that this field cannot be set when spec.os.name is windows." - ), - ) - fs_group_change_policy: Optional[str] = Field( - default=None, - alias="fsGroupChangePolicy", - description=( - "fsGroupChangePolicy defines behavior of changing ownership and permission" - " of the volume before being exposed inside Pod. This field will only apply" - " to volume types which support fsGroup based ownership(and permissions)." - " It will have no effect on ephemeral volume types such as: secret," - ' configmaps and emptydir. Valid values are "OnRootMismatch" and "Always".' - ' If not specified, "Always" is used. Note that this field cannot be set' - " when spec.os.name is windows." - ), - ) - run_as_group: Optional[int] = Field( - default=None, - alias="runAsGroup", - description=( - "The GID to run the entrypoint of the container process. Uses runtime" - " default if unset. May also be set in SecurityContext. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence for that container. Note that this field" - " cannot be set when spec.os.name is windows." - ), - ) - run_as_non_root: Optional[bool] = Field( - default=None, - alias="runAsNonRoot", - description=( - "Indicates that the container must run as a non-root user. If true, the" - " Kubelet will validate the image at runtime to ensure that it does not run" - " as UID 0 (root) and fail to start the container if it does. If unset or" - " false, no such validation will be performed. May also be set in" - " SecurityContext. If set in both SecurityContext and PodSecurityContext," - " the value specified in SecurityContext takes precedence." - ), - ) - run_as_user: Optional[int] = Field( - default=None, - alias="runAsUser", - description=( - "The UID to run the entrypoint of the container process. Defaults to user" - " specified in image metadata if unspecified. May also be set in" - " SecurityContext. If set in both SecurityContext and PodSecurityContext," - " the value specified in SecurityContext takes precedence for that" - " container. Note that this field cannot be set when spec.os.name is" - " windows." - ), - ) - se_linux_options: Optional[SELinuxOptions] = Field( - default=None, - alias="seLinuxOptions", - description=( - "The SELinux context to be applied to all containers. If unspecified, the" - " container runtime will allocate a random SELinux context for each" - " container. May also be set in SecurityContext. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence for that container. Note that this field" - " cannot be set when spec.os.name is windows." - ), - ) - seccomp_profile: Optional[SeccompProfile] = Field( - default=None, - alias="seccompProfile", - description=( - "The seccomp options to use by the containers in this pod. Note that this" - " field cannot be set when spec.os.name is windows." - ), - ) - supplemental_groups: Optional[List[int]] = Field( - default=None, - alias="supplementalGroups", - description=( - "A list of groups applied to the first process run in each container, in" - " addition to the container's primary GID. If unspecified, no groups will" - " be added to any container. Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - sysctls: Optional[List[Sysctl]] = Field( - default=None, - description=( - "Sysctls hold a list of namespaced sysctls used for the pod. Pods with" - " unsupported sysctls (by the container runtime) might fail to launch. Note" - " that this field cannot be set when spec.os.name is windows." - ), - ) - windows_options: Optional[WindowsSecurityContextOptions] = Field( - default=None, - alias="windowsOptions", - description=( - "The Windows specific settings applied to all containers. If unspecified," - " the options within a container's SecurityContext will be used. If set in" - " both SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence. Note that this field cannot be set when" - " spec.os.name is linux." - ), - ) +class DownwardAPIVolumeFile(BaseModel): + field_ref: Annotated[ + Optional[ObjectFieldSelector], + Field( + alias="fieldRef", + description=( + "Required: Selects a field of the pod: only annotations, labels, name" " and namespace are supported." + ), + ), + ] = None + mode: Annotated[ + Optional[int], + Field( + description=( + "Optional: mode bits used to set permissions on this file, must be an" + " octal value between 0000 and 0777 or a decimal value between 0 and" + " 511. YAML accepts both octal and decimal values, JSON requires" + " decimal values for mode bits. If not specified, the volume" + " defaultMode will be used. This might be in conflict with other" + " options that affect the file mode, like fsGroup, and the result can" + " be other mode bits set." + ) + ), + ] = None + path: Annotated[ + str, + Field( + description=( + "Required: Path is the relative path name of the file to be created." + " Must not be absolute or contain the '..' path. Must be utf-8 encoded." + " The first item of the relative path must not start with '..'" + ) + ), + ] + resource_field_ref: Annotated[ + Optional[ResourceFieldSelector], + Field( + alias="resourceFieldRef", + description=( + "Selects a resource of the container: only resources limits and" + " requests (limits.cpu, limits.memory, requests.cpu and" + " requests.memory) are currently supported." + ), + ), + ] = None -class ResourceFieldSelector(BaseModel): - container_name: Optional[str] = Field( - default=None, - alias="containerName", - description="Container name: required for volumes, optional for env vars", - ) - divisor: Optional[resource.Quantity] = Field( - default=None, - description=('Specifies the output format of the exposed resources, defaults to "1"'), - ) - resource: str = Field(..., description="Required: resource to select") +class EnvVarSource(BaseModel): + config_map_key_ref: Annotated[ + Optional[ConfigMapKeySelector], + Field(alias="configMapKeyRef", description="Selects a key of a ConfigMap."), + ] = None + field_ref: Annotated[ + Optional[ObjectFieldSelector], + Field( + alias="fieldRef", + description=( + "Selects a field of the pod: supports metadata.name," + " metadata.namespace, `metadata.labels['']`," + " `metadata.annotations['']`, spec.nodeName," + " spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs." + ), + ), + ] = None + resource_field_ref: Annotated[ + Optional[ResourceFieldSelector], + Field( + alias="resourceFieldRef", + description=( + "Selects a resource of the container: only resources limits and" + " requests (limits.cpu, limits.memory, limits.ephemeral-storage," + " requests.cpu, requests.memory and requests.ephemeral-storage) are" + " currently supported." + ), + ), + ] = None + secret_key_ref: Annotated[ + Optional[SecretKeySelector], + Field( + alias="secretKeyRef", + description="Selects a key of a secret in the pod's namespace", + ), + ] = None + + +class EnvVar(BaseModel): + name: Annotated[ + str, + Field(description="Name of the environment variable. Must be a C_IDENTIFIER."), + ] + value: Annotated[ + Optional[str], + Field( + description=( + "Variable references $(VAR_NAME) are expanded using the previously" + " defined environment variables in the container and any service" + " environment variables. If a variable cannot be resolved, the" + " reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + ' of whether the variable exists or not. Defaults to "".' + ) + ), + ] = None + value_from: Annotated[ + Optional[EnvVarSource], + Field( + alias="valueFrom", + description=("Source for the environment variable's value. Cannot be used if value" " is not empty."), + ), + ] = None + + +class TerminationMessagePolicy(Enum): + fallback_to_logs_on_error = "FallbackToLogsOnError" + file = "File" class ResourceRequirements(BaseModel): - limits: Optional[Dict[str, resource.Quantity]] = Field( - default=None, - description=( - "Limits describes the maximum amount of compute resources allowed. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - requests: Optional[Dict[str, resource.Quantity]] = Field( - default=None, - description=( - "Requests describes the minimum amount of compute resources required. If" - " Requests is omitted for a container, it defaults to Limits if that is" - " explicitly specified, otherwise to an implementation-defined value. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) + limits: Annotated[ + Optional[Dict[str, resource.Quantity]], + Field( + description=( + "Limits describes the maximum amount of compute resources allowed. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + requests: Annotated[ + Optional[Dict[str, resource.Quantity]], + Field( + description=( + "Requests describes the minimum amount of compute resources required." + " If Requests is omitted for a container, it defaults to Limits if that" + " is explicitly specified, otherwise to an implementation-defined" + " value. More info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None -class SecurityContext(BaseModel): - allow_privilege_escalation: Optional[bool] = Field( - default=None, - alias="allowPrivilegeEscalation", - description=( - "AllowPrivilegeEscalation controls whether a process can gain more" - " privileges than its parent process. This bool directly controls if the" - " no_new_privs flag will be set on the container process." - " AllowPrivilegeEscalation is true always when the container is: 1) run as" - " Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - capabilities: Optional[Capabilities] = Field( - default=None, - description=( - "The capabilities to add/drop when running containers. Defaults to the" - " default set of capabilities granted by the container runtime. Note that" - " this field cannot be set when spec.os.name is windows." - ), - ) - privileged: Optional[bool] = Field( - default=None, - description=( - "Run container in privileged mode. Processes in privileged containers are" - " essentially equivalent to root on the host. Defaults to false. Note that" - " this field cannot be set when spec.os.name is windows." - ), - ) - proc_mount: Optional[str] = Field( - default=None, - alias="procMount", - description=( - "procMount denotes the type of proc mount to use for the containers. The" - " default is DefaultProcMount which uses the container runtime defaults for" - " readonly paths and masked paths. This requires the ProcMountType feature" - " flag to be enabled. Note that this field cannot be set when spec.os.name" - " is windows." - ), - ) - read_only_root_filesystem: Optional[bool] = Field( - default=None, - alias="readOnlyRootFilesystem", - description=( - "Whether this container has a read-only root filesystem. Default is false." - " Note that this field cannot be set when spec.os.name is windows." - ), - ) - run_as_group: Optional[int] = Field( - default=None, - alias="runAsGroup", - description=( - "The GID to run the entrypoint of the container process. Uses runtime" - " default if unset. May also be set in PodSecurityContext. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence. Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - run_as_non_root: Optional[bool] = Field( - default=None, - alias="runAsNonRoot", - description=( - "Indicates that the container must run as a non-root user. If true, the" - " Kubelet will validate the image at runtime to ensure that it does not run" - " as UID 0 (root) and fail to start the container if it does. If unset or" - " false, no such validation will be performed. May also be set in" - " PodSecurityContext. If set in both SecurityContext and" - " PodSecurityContext, the value specified in SecurityContext takes" - " precedence." - ), - ) - run_as_user: Optional[int] = Field( - default=None, - alias="runAsUser", - description=( - "The UID to run the entrypoint of the container process. Defaults to user" - " specified in image metadata if unspecified. May also be set in" - " PodSecurityContext. If set in both SecurityContext and" - " PodSecurityContext, the value specified in SecurityContext takes" - " precedence. Note that this field cannot be set when spec.os.name is" - " windows." - ), - ) - se_linux_options: Optional[SELinuxOptions] = Field( - default=None, - alias="seLinuxOptions", - description=( - "The SELinux context to be applied to the container. If unspecified, the" - " container runtime will allocate a random SELinux context for each" - " container. May also be set in PodSecurityContext. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence. Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - seccomp_profile: Optional[SeccompProfile] = Field( - default=None, - alias="seccompProfile", - description=( - "The seccomp options to use by this container. If seccomp options are" - " provided at both the pod & container level, the container options" - " override the pod options. Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - windows_options: Optional[WindowsSecurityContextOptions] = Field( - default=None, - alias="windowsOptions", - description=( - "The Windows specific settings applied to all containers. If unspecified," - " the options from the PodSecurityContext will be used. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence. Note that this field cannot be set when" - " spec.os.name is linux." - ), - ) +class PodDNSConfig(BaseModel): + nameservers: Annotated[ + Optional[List[str]], + Field( + description=( + "A list of DNS name server IP addresses. This will be appended to the" + " base nameservers generated from DNSPolicy. Duplicated nameservers" + " will be removed." + ) + ), + ] = None + options: Annotated[ + Optional[List[PodDNSConfigOption]], + Field( + description=( + "A list of DNS resolver options. This will be merged with the base" + " options generated from DNSPolicy. Duplicated entries will be removed." + " Resolution options given in Options will override those that appear" + " in the base DNSPolicy." + ) + ), + ] = None + searches: Annotated[ + Optional[List[str]], + Field( + description=( + "A list of DNS search domains for host-name lookup. This will be" + " appended to the base search paths generated from DNSPolicy." + " Duplicated search paths will be removed." + ) + ), + ] = None -class ServicePort(BaseModel): - app_protocol: Optional[str] = Field( - default=None, - alias="appProtocol", - description=( - "The application protocol for this port. This field follows standard" - " Kubernetes label syntax. Un-prefixed names are reserved for IANA standard" - " service names (as per RFC-6335 and" - " http://www.iana.org/assignments/service-names). Non-standard protocols" - " should use prefixed names such as mycompany.com/my-custom-protocol." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "The name of this port within the service. This must be a DNS_LABEL. All" - " ports within a ServiceSpec must have unique names. When considering the" - " endpoints for a Service, this must match the 'name' field in the" - " EndpointPort. Optional if only one ServicePort is defined on this" - " service." - ), - ) - node_port: Optional[int] = Field( - default=None, - alias="nodePort", - description=( - "The port on each node on which this service is exposed when type is" - " NodePort or LoadBalancer. Usually assigned by the system. If a value is" - " specified, in-range, and not in use it will be used, otherwise the" - " operation will fail. If not specified, a port will be allocated if this" - " Service requires one. If this field is specified when creating a Service" - " which does not need it, creation will fail. This field will be wiped when" - " updating a Service to no longer need it (e.g. changing type from NodePort" - " to ClusterIP). More info:" - " https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" - ), - ) - port: int = Field(..., description="The port that will be exposed by this service.") - protocol: Optional[Protocol] = Field( - default=None, - description=( - 'The IP protocol for this port. Supports "TCP", "UDP", and "SCTP". Default' - ' is TCP.\n\nPossible enum values:\n - `"SCTP"` is the SCTP protocol.\n -' - ' `"TCP"` is the TCP protocol.\n - `"UDP"` is the UDP protocol.' - ), - ) - target_port: Optional[intstr.IntOrString] = Field( - default=None, - alias="targetPort", - description=( - "Number or name of the port to access on the pods targeted by the service." - " Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If" - " this is a string, it will be looked up as a named port in the target" - " Pod's container ports. If this is not specified, the value of the 'port'" - " field is used (an identity map). This field is ignored for services with" - " clusterIP=None, and should be omitted or set equal to the 'port' field." - " More info:" - " https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service" - ), - ) +class ConfigMapProjection(BaseModel): + items: Annotated[ + Optional[List[KeyToPath]], + Field( + description=( + "If unspecified, each key-value pair in the Data field of the" + " referenced ConfigMap will be projected into the volume as a file" + " whose name is the key and content is the value. If specified, the" + " listed keys will be projected into the specified paths, and unlisted" + " keys will not be present. If a key is specified which is not present" + " in the ConfigMap, the volume setup will error unless it is marked" + " optional. Paths must be relative and may not contain the '..' path or" + " start with '..'." + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the ConfigMap or its keys must be defined"), + ] = None -class TCPSocketAction(BaseModel): - host: Optional[str] = Field( - default=None, - description="Optional: Host name to connect to, defaults to the pod IP.", - ) - port: intstr.IntOrString = Field( - ..., - description=( - "Number or name of the port to access on the container. Number must be in" - " the range 1 to 65535. Name must be an IANA_SVC_NAME." - ), - ) +class ConfigMapVolumeSource(BaseModel): + default_mode: Annotated[ + Optional[int], + Field( + alias="defaultMode", + description=( + "Optional: mode bits used to set permissions on created files by" + " default. Must be an octal value between 0000 and 0777 or a decimal" + " value between 0 and 511. YAML accepts both octal and decimal values," + " JSON requires decimal values for mode bits. Defaults to 0644." + " Directories within the path are not affected by this setting. This" + " might be in conflict with other options that affect the file mode," + " like fsGroup, and the result can be other mode bits set." + ), + ), + ] = None + items: Annotated[ + Optional[List[KeyToPath]], + Field( + description=( + "If unspecified, each key-value pair in the Data field of the" + " referenced ConfigMap will be projected into the volume as a file" + " whose name is the key and content is the value. If specified, the" + " listed keys will be projected into the specified paths, and unlisted" + " keys will not be present. If a key is specified which is not present" + " in the ConfigMap, the volume setup will error unless it is marked" + " optional. Paths must be relative and may not contain the '..' path or" + " start with '..'." + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the ConfigMap or its keys must be defined"), + ] = None -class DownwardAPIVolumeFile(BaseModel): - field_ref: Optional[ObjectFieldSelector] = Field( - default=None, - alias="fieldRef", - description=( - "Required: Selects a field of the pod: only annotations, labels, name and" " namespace are supported." - ), - ) - mode: Optional[int] = Field( - default=None, - description=( - "Optional: mode bits used to set permissions on this file, must be an octal" - " value between 0000 and 0777 or a decimal value between 0 and 511. YAML" - " accepts both octal and decimal values, JSON requires decimal values for" - " mode bits. If not specified, the volume defaultMode will be used. This" - " might be in conflict with other options that affect the file mode, like" - " fsGroup, and the result can be other mode bits set." - ), - ) - path: str = Field( - ..., - description=( - "Required: Path is the relative path name of the file to be created. Must" - " not be absolute or contain the '..' path. Must be utf-8 encoded. The" - " first item of the relative path must not start with '..'" - ), - ) - resource_field_ref: Optional[ResourceFieldSelector] = Field( - default=None, - alias="resourceFieldRef", - description=( - "Selects a resource of the container: only resources limits and requests" - " (limits.cpu, limits.memory, requests.cpu and requests.memory) are" - " currently supported." - ), - ) +class DownwardAPIProjection(BaseModel): + items: Annotated[ + Optional[List[DownwardAPIVolumeFile]], + Field(description="Items is a list of DownwardAPIVolume file"), + ] = None class DownwardAPIVolumeSource(BaseModel): - default_mode: Optional[int] = Field( - default=None, - alias="defaultMode", - description=( - "Optional: mode bits to use on created files by default. Must be a" - " Optional: mode bits used to set permissions on created files by default." - " Must be an octal value between 0000 and 0777 or a decimal value between 0" - " and 511. YAML accepts both octal and decimal values, JSON requires" - " decimal values for mode bits. Defaults to 0644. Directories within the" - " path are not affected by this setting. This might be in conflict with" - " other options that affect the file mode, like fsGroup, and the result can" - " be other mode bits set." - ), - ) - items: Optional[List[DownwardAPIVolumeFile]] = Field( - default=None, description="Items is a list of downward API volume file" - ) + default_mode: Annotated[ + Optional[int], + Field( + alias="defaultMode", + description=( + "Optional: mode bits to use on created files by default. Must be a" + " Optional: mode bits used to set permissions on created files by" + " default. Must be an octal value between 0000 and 0777 or a decimal" + " value between 0 and 511. YAML accepts both octal and decimal values," + " JSON requires decimal values for mode bits. Defaults to 0644." + " Directories within the path are not affected by this setting. This" + " might be in conflict with other options that affect the file mode," + " like fsGroup, and the result can be other mode bits set." + ), + ), + ] = None + items: Annotated[ + Optional[List[DownwardAPIVolumeFile]], + Field(description="Items is a list of downward API volume file"), + ] = None -class EnvVarSource(BaseModel): - config_map_key_ref: Optional[ConfigMapKeySelector] = Field( - default=None, - alias="configMapKeyRef", - description="Selects a key of a ConfigMap.", - ) - field_ref: Optional[ObjectFieldSelector] = Field( - default=None, - alias="fieldRef", - description=( - "Selects a field of the pod: supports metadata.name, metadata.namespace," - " `metadata.labels['']`, `metadata.annotations['']`," - " spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP," - " status.podIPs." - ), - ) - resource_field_ref: Optional[ResourceFieldSelector] = Field( - default=None, - alias="resourceFieldRef", - description=( - "Selects a resource of the container: only resources limits and requests" - " (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu," - " requests.memory and requests.ephemeral-storage) are currently supported." - ), - ) - secret_key_ref: Optional[SecretKeySelector] = Field( - default=None, - alias="secretKeyRef", - description="Selects a key of a secret in the pod's namespace", - ) +class HTTPGetAction(BaseModel): + host: Annotated[ + Optional[str], + Field( + description=( + "Host name to connect to, defaults to the pod IP. You probably want to" + ' set "Host" in httpHeaders instead.' + ) + ), + ] = None + http_headers: Annotated[ + Optional[List[HTTPHeader]], + Field( + alias="httpHeaders", + description=("Custom headers to set in the request. HTTP allows repeated headers."), + ), + ] = None + path: Annotated[Optional[str], Field(description="Path to access on the HTTP server.")] = None + port: Annotated[ + int, + Field( + description=( + "Name or number of the port to access on the container. Number must be" + " in the range 1 to 65535. Name must be an IANA_SVC_NAME." + ) + ), + ] + scheme: Annotated[ + Optional[Scheme], + Field( + description=( + "Scheme to use for connecting to the host. Defaults to" + ' HTTP.\n\nPossible enum values:\n - `"HTTP"` means that the scheme' + ' used will be http://\n - `"HTTPS"` means that the scheme used will be' + " https://" + ) + ), + ] = None -class Event(BaseModel): - action: Optional[str] = Field( - default=None, - description="What action was taken/failed regarding to the Regarding object.", - ) - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - count: Optional[int] = Field(default=None, description="The number of times this event has occurred.") - event_time: Optional[v1.MicroTime] = Field( - default=None, - alias="eventTime", - description="Time when this Event was first observed.", - ) - first_timestamp: Optional[v1.Time] = Field( - default=None, - alias="firstTimestamp", - description=("The time at which the event was first recorded. (Time of server receipt is" " in TypeMeta.)"), - ) - involved_object: ObjectReference = Field( - ..., alias="involvedObject", description="The object that this event is about." - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - last_timestamp: Optional[v1.Time] = Field( - default=None, - alias="lastTimestamp", - description=("The time at which the most recent occurrence of this event was recorded."), - ) - message: Optional[str] = Field( - default=None, - description="A human-readable description of the status of this operation.", - ) - metadata: v1.ObjectMeta = Field( - ..., - description=( - "Standard object's metadata. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - ), - ) - reason: Optional[str] = Field( - default=None, - description=( - "This should be a short, machine understandable string that gives the" - " reason for the transition into the object's current status." - ), - ) - related: Optional[ObjectReference] = Field( - default=None, description="Optional secondary object for more complex actions." - ) - reporting_component: Optional[str] = Field( - default=None, - alias="reportingComponent", - description=("Name of the controller that emitted this Event, e.g." " `kubernetes.io/kubelet`."), - ) - reporting_instance: Optional[str] = Field( - default=None, - alias="reportingInstance", - description="ID of the controller instance, e.g. `kubelet-xyzf`.", - ) - series: Optional[EventSeries] = Field( - default=None, - description=("Data about the Event series this event represents or nil if it's a" " singleton Event."), - ) - source: Optional[EventSource] = Field( - default=None, - description=("The component reporting this event. Should be a short machine" " understandable string."), - ) - type: Optional[str] = Field( - default=None, - description=("Type of this event (Normal, Warning), new types could be added in the" " future"), - ) +class NodeSelector(BaseModel): + node_selector_terms: Annotated[ + List[NodeSelectorTerm], + Field( + alias="nodeSelectorTerms", + description="Required. A list of node selector terms. The terms are ORed.", + ), + ] -class LifecycleHandler(BaseModel): - exec: Optional[ExecAction] = Field(default=None, description="Exec specifies the action to take.") - http_get: Optional[HTTPGetAction] = Field( - default=None, - alias="httpGet", - description="HTTPGet specifies the http request to perform.", - ) - tcp_socket: Optional[TCPSocketAction] = Field( - default=None, - alias="tcpSocket", - description=( - "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for" - " the backward compatibility. There are no validation of this field and" - " lifecycle hooks will fail in runtime when tcp handler is specified." - ), - ) +class PersistentVolumeClaimStatus(BaseModel): + access_modes: Annotated[ + Optional[List[str]], + Field( + alias="accessModes", + description=( + "AccessModes contains the actual access modes the volume backing the" + " PVC has. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1" + ), + ), + ] = None + allocated_resources: Annotated[ + Optional[Dict[str, resource.Quantity]], + Field( + alias="allocatedResources", + description=( + "The storage resource within AllocatedResources tracks the capacity" + " allocated to a PVC. It may be larger than the actual capacity when a" + " volume expansion operation is requested. For storage quota, the" + " larger value from allocatedResources and PVC.spec.resources is used." + " If allocatedResources is not set, PVC.spec.resources alone is used" + " for quota calculation. If a volume expansion capacity request is" + " lowered, allocatedResources is only lowered if there are no expansion" + " operations in progress and if the actual volume capacity is equal or" + " lower than the requested capacity. This is an alpha field and" + " requires enabling RecoverVolumeExpansionFailure feature." + ), + ), + ] = None + capacity: Annotated[ + Optional[Dict[str, resource.Quantity]], + Field(description="Represents the actual resources of the underlying volume."), + ] = None + conditions: Annotated[ + Optional[List[PersistentVolumeClaimCondition]], + Field( + description=( + "Current Condition of persistent volume claim. If underlying persistent" + " volume is being resized then the Condition will be set to" + " 'ResizeStarted'." + ) + ), + ] = None + phase: Annotated[ + Optional[Phase], + Field( + description=( + "Phase represents the current phase of" + ' PersistentVolumeClaim.\n\nPossible enum values:\n - `"Bound"` used' + ' for PersistentVolumeClaims that are bound\n - `"Lost"` used for' + " PersistentVolumeClaims that lost their underlying PersistentVolume." + " The claim was bound to a PersistentVolume and this volume does not" + ' exist any longer and all data on it was lost.\n - `"Pending"` used' + " for PersistentVolumeClaims that are not yet bound" + ) + ), + ] = None + resize_status: Annotated[ + Optional[str], + Field( + alias="resizeStatus", + description=( + "ResizeStatus stores status of resize operation. ResizeStatus is not" + " set by default but when expansion is complete resizeStatus is set to" + " empty string by resize controller or kubelet. This is an alpha field" + " and requires enabling RecoverVolumeExpansionFailure feature." + ), + ), + ] = None + + +class PodAffinityTerm(BaseModel): + label_selector: Annotated[ + Optional[v1.LabelSelector], + Field( + alias="labelSelector", + description="A label query over a set of resources, in this case pods.", + ), + ] = None + namespace_selector: Annotated[ + Optional[v1.LabelSelector], + Field( + alias="namespaceSelector", + description=( + "A label query over the set of namespaces that the term applies to. The" + " term is applied to the union of the namespaces selected by this field" + " and the ones listed in the namespaces field. null selector and null" + ' or empty namespaces list means "this pod\'s namespace". An empty' + " selector ({}) matches all namespaces. This field is beta-level and is" + " only honored when PodAffinityNamespaceSelector feature is enabled." + ), + ), + ] = None + namespaces: Annotated[ + Optional[List[str]], + Field( + description=( + "namespaces specifies a static list of namespace names that the term" + " applies to. The term is applied to the union of the namespaces listed" + " in this field and the ones selected by namespaceSelector. null or" + " empty namespaces list and null namespaceSelector means \"this pod's" + ' namespace"' + ) + ), + ] = None + topology_key: Annotated[ + str, + Field( + alias="topologyKey", + description=( + "This pod should be co-located (affinity) or not co-located" + " (anti-affinity) with the pods matching the labelSelector in the" + " specified namespaces, where co-located is defined as running on a" + " node whose value of the label with key topologyKey matches that of" + " any node on which any of the selected pods is running. Empty" + " topologyKey is not allowed." + ), + ), + ] class NodeAffinity(BaseModel): - preferred_during_scheduling_ignored_during_execution: Optional[List[PreferredSchedulingTerm]] = Field( - default=None, - alias="preferredDuringSchedulingIgnoredDuringExecution", - description=( - "The scheduler will prefer to schedule pods to nodes that satisfy the" - " affinity expressions specified by this field, but it may choose a node" - " that violates one or more of the expressions. The node that is most" - " preferred is the one with the greatest sum of weights, i.e. for each node" - " that meets all of the scheduling requirements (resource request," - " requiredDuringScheduling affinity expressions, etc.), compute a sum by" - ' iterating through the elements of this field and adding "weight" to the' - " sum if the node matches the corresponding matchExpressions; the node(s)" - " with the highest sum are the most preferred." - ), - ) - required_during_scheduling_ignored_during_execution: Optional[NodeSelector] = Field( - default=None, - alias="requiredDuringSchedulingIgnoredDuringExecution", - description=( - "If the affinity requirements specified by this field are not met at" - " scheduling time, the pod will not be scheduled onto the node. If the" - " affinity requirements specified by this field cease to be met at some" - " point during pod execution (e.g. due to an update), the system may or may" - " not try to eventually evict the pod from its node." - ), - ) + preferred_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[PreferredSchedulingTerm]], + Field( + alias="preferredDuringSchedulingIgnoredDuringExecution", + description=( + "The scheduler will prefer to schedule pods to nodes that satisfy the" + " affinity expressions specified by this field, but it may choose a" + " node that violates one or more of the expressions. The node that is" + " most preferred is the one with the greatest sum of weights, i.e. for" + " each node that meets all of the scheduling requirements (resource" + " request, requiredDuringScheduling affinity expressions, etc.)," + " compute a sum by iterating through the elements of this field and" + ' adding "weight" to the sum if the node matches the corresponding' + " matchExpressions; the node(s) with the highest sum are the most" + " preferred." + ), + ), + ] = None + required_during_scheduling_ignored_during_execution: Annotated[ + Optional[NodeSelector], + Field( + alias="requiredDuringSchedulingIgnoredDuringExecution", + description=( + "If the affinity requirements specified by this field are not met at" + " scheduling time, the pod will not be scheduled onto the node. If the" + " affinity requirements specified by this field cease to be met at some" + " point during pod execution (e.g. due to an update), the system may or" + " may not try to eventually evict the pod from its node." + ), + ), + ] = None class PersistentVolumeClaimSpec(BaseModel): - access_modes: Optional[List[str]] = Field( - default=None, - alias="accessModes", - description=( - "AccessModes contains the desired access modes the volume should have. More" - " info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1" - ), - ) - data_source: Optional[TypedLocalObjectReference] = Field( - default=None, - alias="dataSource", - description=( - "This field can be used to specify either: * An existing VolumeSnapshot" - " object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC" - " (PersistentVolumeClaim) If the provisioner or an external controller can" - " support the specified data source, it will create a new volume based on" - " the contents of the specified data source. If the AnyVolumeDataSource" - " feature gate is enabled, this field will always have the same contents as" - " the DataSourceRef field." - ), - ) - data_source_ref: Optional[TypedLocalObjectReference] = Field( - default=None, - alias="dataSourceRef", - description=( - "Specifies the object from which to populate the volume with data, if a" - " non-empty volume is desired. This may be any local object from a" - " non-empty API group (non core object) or a PersistentVolumeClaim object." - " When this field is specified, volume binding will only succeed if the" - " type of the specified object matches some installed volume populator or" - " dynamic provisioner. This field will replace the functionality of the" - " DataSource field and as such if both fields are non-empty, they must have" - " the same value. For backwards compatibility, both fields (DataSource and" - " DataSourceRef) will be set to the same value automatically if one of them" - " is empty and the other is non-empty. There are two important differences" - " between DataSource and DataSourceRef: * While DataSource only allows two" - " specific types of objects, DataSourceRef\n allows any non-core object," - " as well as PersistentVolumeClaim objects.\n* While DataSource ignores" - " disallowed values (dropping them), DataSourceRef\n preserves all values," - " and generates an error if a disallowed value is\n specified.\n(Alpha)" - " Using this field requires the AnyVolumeDataSource feature gate to be" - " enabled." - ), - ) - resources: Optional[ResourceRequirements] = Field( - default=None, - description=( - "Resources represents the minimum resources the volume should have. If" - " RecoverVolumeExpansionFailure feature is enabled users are allowed to" - " specify resource requirements that are lower than previous value but must" - " still be higher than capacity recorded in the status field of the claim." - " More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources" - ), - ) - selector: Optional[v1.LabelSelector] = Field( - default=None, description="A label query over volumes to consider for binding." - ) - storage_class_name: Optional[str] = Field( - default=None, - alias="storageClassName", - description=( - "Name of the StorageClass required by the claim. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1" - ), - ) - volume_mode: Optional[str] = Field( - default=None, - alias="volumeMode", - description=( - "volumeMode defines what type of volume is required by the claim. Value of" - " Filesystem is implied when not included in claim spec." - ), - ) - volume_name: Optional[str] = Field( - default=None, - alias="volumeName", - description=("VolumeName is the binding reference to the PersistentVolume backing this" " claim."), - ) + access_modes: Annotated[ + Optional[List[str]], + Field( + alias="accessModes", + description=( + "AccessModes contains the desired access modes the volume should have." + " More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1" + ), + ), + ] = None + data_source: Annotated[ + Optional[TypedLocalObjectReference], + Field( + alias="dataSource", + description=( + "This field can be used to specify either: * An existing VolumeSnapshot" + " object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC" + " (PersistentVolumeClaim) If the provisioner or an external controller" + " can support the specified data source, it will create a new volume" + " based on the contents of the specified data source. If the" + " AnyVolumeDataSource feature gate is enabled, this field will always" + " have the same contents as the DataSourceRef field." + ), + ), + ] = None + data_source_ref: Annotated[ + Optional[TypedLocalObjectReference], + Field( + alias="dataSourceRef", + description=( + "Specifies the object from which to populate the volume with data, if a" + " non-empty volume is desired. This may be any local object from a" + " non-empty API group (non core object) or a PersistentVolumeClaim" + " object. When this field is specified, volume binding will only" + " succeed if the type of the specified object matches some installed" + " volume populator or dynamic provisioner. This field will replace the" + " functionality of the DataSource field and as such if both fields are" + " non-empty, they must have the same value. For backwards" + " compatibility, both fields (DataSource and DataSourceRef) will be set" + " to the same value automatically if one of them is empty and the other" + " is non-empty. There are two important differences between DataSource" + " and DataSourceRef: * While DataSource only allows two specific types" + " of objects, DataSourceRef\n allows any non-core object, as well as" + " PersistentVolumeClaim objects.\n* While DataSource ignores disallowed" + " values (dropping them), DataSourceRef\n preserves all values, and" + " generates an error if a disallowed value is\n specified.\n(Alpha)" + " Using this field requires the AnyVolumeDataSource feature gate to be" + " enabled." + ), + ), + ] = None + resources: Annotated[ + Optional[ResourceRequirements], + Field( + description=( + "Resources represents the minimum resources the volume should have. If" + " RecoverVolumeExpansionFailure feature is enabled users are allowed to" + " specify resource requirements that are lower than previous value but" + " must still be higher than capacity recorded in the status field of" + " the claim. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources" + ) + ), + ] = None + selector: Annotated[ + Optional[v1.LabelSelector], + Field(description="A label query over volumes to consider for binding."), + ] = None + storage_class_name: Annotated[ + Optional[str], + Field( + alias="storageClassName", + description=( + "Name of the StorageClass required by the claim. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1" + ), + ), + ] = None + volume_mode: Annotated[ + Optional[str], + Field( + alias="volumeMode", + description=( + "volumeMode defines what type of volume is required by the claim. Value" + " of Filesystem is implied when not included in claim spec." + ), + ), + ] = None + volume_name: Annotated[ + Optional[str], + Field( + alias="volumeName", + description=("VolumeName is the binding reference to the PersistentVolume backing" " this claim."), + ), + ] = None -class PersistentVolumeClaimTemplate(BaseModel): - metadata: Optional[v1.ObjectMeta] = Field( - default=None, - description=( - "May contain labels and annotations that will be copied into the PVC when" - " creating it. No other fields are allowed and will be rejected during" - " validation." - ), - ) - spec: PersistentVolumeClaimSpec = Field( - ..., - description=( - "The specification for the PersistentVolumeClaim. The entire content is" - " copied unchanged into the PVC that gets created from this template. The" - " same fields as in a PersistentVolumeClaim are also valid here." - ), - ) +class VolumeProjection(BaseModel): + config_map: Annotated[ + Optional[ConfigMapProjection], + Field( + alias="configMap", + description="information about the configMap data to project", + ), + ] = None + downward_api: Annotated[ + Optional[DownwardAPIProjection], + Field( + alias="downwardAPI", + description="information about the downwardAPI data to project", + ), + ] = None + secret: Annotated[ + Optional[SecretProjection], + Field(description="information about the secret data to project"), + ] = None + service_account_token: Annotated[ + Optional[ServiceAccountTokenProjection], + Field( + alias="serviceAccountToken", + description="information about the serviceAccountToken data to project", + ), + ] = None -class PodAffinityTerm(BaseModel): - label_selector: Optional[v1.LabelSelector] = Field( - default=None, - alias="labelSelector", - description="A label query over a set of resources, in this case pods.", - ) - namespace_selector: Optional[v1.LabelSelector] = Field( - default=None, - alias="namespaceSelector", - description=( - "A label query over the set of namespaces that the term applies to. The" - " term is applied to the union of the namespaces selected by this field and" - " the ones listed in the namespaces field. null selector and null or empty" - ' namespaces list means "this pod\'s namespace". An empty selector ({})' - " matches all namespaces. This field is beta-level and is only honored when" - " PodAffinityNamespaceSelector feature is enabled." - ), - ) - namespaces: Optional[List[str]] = Field( - default=None, - description=( - "namespaces specifies a static list of namespace names that the term" - " applies to. The term is applied to the union of the namespaces listed in" - " this field and the ones selected by namespaceSelector. null or empty" - ' namespaces list and null namespaceSelector means "this pod\'s namespace"' - ), - ) - topology_key: str = Field( - ..., - alias="topologyKey", - description=( - "This pod should be co-located (affinity) or not co-located (anti-affinity)" - " with the pods matching the labelSelector in the specified namespaces," - " where co-located is defined as running on a node whose value of the label" - " with key topologyKey matches that of any node on which any of the" - " selected pods is running. Empty topologyKey is not allowed." - ), - ) +class LifecycleHandler(BaseModel): + exec: Annotated[Optional[ExecAction], Field(description="Exec specifies the action to take.")] = None + http_get: Annotated[ + Optional[HTTPGetAction], + Field( + alias="httpGet", + description="HTTPGet specifies the http request to perform.", + ), + ] = None + tcp_socket: Annotated[ + Optional[TCPSocketAction], + Field( + alias="tcpSocket", + description=( + "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept" + " for the backward compatibility. There are no validation of this field" + " and lifecycle hooks will fail in runtime when tcp handler is" + " specified." + ), + ), + ] = None class Probe(BaseModel): - exec: Optional[ExecAction] = Field(default=None, description="Exec specifies the action to take.") - failure_threshold: Optional[int] = Field( - default=None, - alias="failureThreshold", - description=( - "Minimum consecutive failures for the probe to be considered failed after" - " having succeeded. Defaults to 3. Minimum value is 1." - ), - ) - grpc: Optional[GRPCAction] = Field( - default=None, - description=( - "GRPC specifies an action involving a GRPC port. This is an alpha field and" - " requires enabling GRPCContainerProbe feature gate." - ), - ) - http_get: Optional[HTTPGetAction] = Field( - default=None, - alias="httpGet", - description="HTTPGet specifies the http request to perform.", - ) - initial_delay_seconds: Optional[int] = Field( - default=None, - alias="initialDelaySeconds", - description=( - "Number of seconds after the container has started before liveness probes" - " are initiated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - period_seconds: Optional[int] = Field( - default=None, - alias="periodSeconds", - description=("How often (in seconds) to perform the probe. Default to 10 seconds." " Minimum value is 1."), - ) - success_threshold: Optional[int] = Field( - default=None, - alias="successThreshold", - description=( - "Minimum consecutive successes for the probe to be considered successful" - " after having failed. Defaults to 1. Must be 1 for liveness and startup." - " Minimum value is 1." - ), - ) - tcp_socket: Optional[TCPSocketAction] = Field( - default=None, - alias="tcpSocket", - description="TCPSocket specifies an action involving a TCP port.", - ) - termination_grace_period_seconds: Optional[int] = Field( - default=None, - alias="terminationGracePeriodSeconds", - description=( - "Optional duration in seconds the pod needs to terminate gracefully upon" - " probe failure. The grace period is the duration in seconds after the" - " processes running in the pod are sent a termination signal and the time" - " when the processes are forcibly halted with a kill signal. Set this value" - " longer than the expected cleanup time for your process. If this value is" - " nil, the pod's terminationGracePeriodSeconds will be used. Otherwise," - " this value overrides the value provided by the pod spec. Value must be" - " non-negative integer. The value zero indicates stop immediately via the" - " kill signal (no opportunity to shut down). This is a beta field and" - " requires enabling ProbeTerminationGracePeriod feature gate. Minimum value" - " is 1. spec.terminationGracePeriodSeconds is used if unset." - ), - ) - timeout_seconds: Optional[int] = Field( - default=None, - alias="timeoutSeconds", - description=( - "Number of seconds after which the probe times out. Defaults to 1 second." - " Minimum value is 1. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) + exec: Annotated[Optional[ExecAction], Field(description="Exec specifies the action to take.")] = None + failure_threshold: Annotated[ + Optional[int], + Field( + alias="failureThreshold", + description=( + "Minimum consecutive failures for the probe to be considered failed" + " after having succeeded. Defaults to 3. Minimum value is 1." + ), + ), + ] = None + grpc: Annotated[ + Optional[GRPCAction], + Field( + description=( + "GRPC specifies an action involving a GRPC port. This is an alpha field" + " and requires enabling GRPCContainerProbe feature gate." + ) + ), + ] = None + http_get: Annotated[ + Optional[HTTPGetAction], + Field( + alias="httpGet", + description="HTTPGet specifies the http request to perform.", + ), + ] = None + initial_delay_seconds: Annotated[ + Optional[int], + Field( + alias="initialDelaySeconds", + description=( + "Number of seconds after the container has started before liveness" + " probes are initiated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + period_seconds: Annotated[ + Optional[int], + Field( + alias="periodSeconds", + description=("How often (in seconds) to perform the probe. Default to 10 seconds." " Minimum value is 1."), + ), + ] = None + success_threshold: Annotated[ + Optional[int], + Field( + alias="successThreshold", + description=( + "Minimum consecutive successes for the probe to be considered" + " successful after having failed. Defaults to 1. Must be 1 for liveness" + " and startup. Minimum value is 1." + ), + ), + ] = None + tcp_socket: Annotated[ + Optional[TCPSocketAction], + Field( + alias="tcpSocket", + description="TCPSocket specifies an action involving a TCP port.", + ), + ] = None + termination_grace_period_seconds: Annotated[ + Optional[int], + Field( + alias="terminationGracePeriodSeconds", + description=( + "Optional duration in seconds the pod needs to terminate gracefully" + " upon probe failure. The grace period is the duration in seconds after" + " the processes running in the pod are sent a termination signal and" + " the time when the processes are forcibly halted with a kill signal." + " Set this value longer than the expected cleanup time for your" + " process. If this value is nil, the pod's" + " terminationGracePeriodSeconds will be used. Otherwise, this value" + " overrides the value provided by the pod spec. Value must be" + " non-negative integer. The value zero indicates stop immediately via" + " the kill signal (no opportunity to shut down). This is a beta field" + " and requires enabling ProbeTerminationGracePeriod feature gate." + " Minimum value is 1. spec.terminationGracePeriodSeconds is used if" + " unset." + ), + ), + ] = None + timeout_seconds: Annotated[ + Optional[int], + Field( + alias="timeoutSeconds", + description=( + "Number of seconds after which the probe times out. Defaults to 1" + " second. Minimum value is 1. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None class WeightedPodAffinityTerm(BaseModel): - pod_affinity_term: PodAffinityTerm = Field( - ..., - alias="podAffinityTerm", - description=("Required. A pod affinity term, associated with the corresponding weight."), - ) - weight: int = Field( - ..., - description=("weight associated with matching the corresponding podAffinityTerm, in the" " range 1-100."), - ) + pod_affinity_term: Annotated[ + PodAffinityTerm, + Field( + alias="podAffinityTerm", + description=("Required. A pod affinity term, associated with the corresponding" " weight."), + ), + ] + weight: Annotated[ + int, + Field( + description=("weight associated with matching the corresponding podAffinityTerm, in" " the range 1-100.") + ), + ] -class DownwardAPIProjection(BaseModel): - items: Optional[List[DownwardAPIVolumeFile]] = Field( - default=None, description="Items is a list of DownwardAPIVolume file" - ) +class Event(BaseModel): + action: Annotated[ + Optional[str], + Field(description=("What action was taken/failed regarding to the Regarding object.")), + ] = None + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + count: Annotated[Optional[int], Field(description="The number of times this event has occurred.")] = None + event_time: Annotated[ + Optional[v1.MicroTime], + Field(alias="eventTime", description="Time when this Event was first observed."), + ] = None + first_timestamp: Annotated[ + Optional[v1.Time], + Field( + alias="firstTimestamp", + description=( + "The time at which the event was first recorded. (Time of server" " receipt is in TypeMeta.)" + ), + ), + ] = None + involved_object: Annotated[ + ObjectReference, + Field(alias="involvedObject", description="The object that this event is about."), + ] + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + last_timestamp: Annotated[ + Optional[v1.Time], + Field( + alias="lastTimestamp", + description=("The time at which the most recent occurrence of this event was" " recorded."), + ), + ] = None + message: Annotated[ + Optional[str], + Field(description="A human-readable description of the status of this operation."), + ] = None + metadata: Annotated[ + v1.ObjectMeta, + Field( + description=( + "Standard object's metadata. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + ) + ), + ] + reason: Annotated[ + Optional[str], + Field( + description=( + "This should be a short, machine understandable string that gives the" + " reason for the transition into the object's current status." + ) + ), + ] = None + related: Annotated[ + Optional[ObjectReference], + Field(description="Optional secondary object for more complex actions."), + ] = None + reporting_component: Annotated[ + Optional[str], + Field( + alias="reportingComponent", + description=("Name of the controller that emitted this Event, e.g." " `kubernetes.io/kubelet`."), + ), + ] = None + reporting_instance: Annotated[ + Optional[str], + Field( + alias="reportingInstance", + description="ID of the controller instance, e.g. `kubelet-xyzf`.", + ), + ] = None + series: Annotated[ + Optional[EventSeries], + Field(description=("Data about the Event series this event represents or nil if it's a" " singleton Event.")), + ] = None + source: Annotated[ + Optional[EventSource], + Field(description=("The component reporting this event. Should be a short machine" " understandable string.")), + ] = None + type: Annotated[ + Optional[str], + Field(description=("Type of this event (Normal, Warning), new types could be added in the" " future")), + ] = None -class EnvVar(BaseModel): - name: str = Field(..., description="Name of the environment variable. Must be a C_IDENTIFIER.") - value: Optional[str] = Field( - default=None, - description=( - "Variable references $(VAR_NAME) are expanded using the previously defined" - " environment variables in the container and any service environment" - " variables. If a variable cannot be resolved, the reference in the input" - " string will be unchanged. Double $$ are reduced to a single $, which" - ' allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will' - ' produce the string literal "$(VAR_NAME)". Escaped references will never' - " be expanded, regardless of whether the variable exists or not. Defaults" - ' to "".' - ), - ) - value_from: Optional[EnvVarSource] = Field( - default=None, - alias="valueFrom", - description=("Source for the environment variable's value. Cannot be used if value is" " not empty."), - ) +class PersistentVolumeClaim(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: Annotated[ + Optional[v1.ObjectMeta], + Field( + description=( + "Standard object's metadata. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + ) + ), + ] = None + spec: Annotated[ + Optional[PersistentVolumeClaimSpec], + Field( + description=( + "Spec defines the desired characteristics of a volume requested by a" + " pod author. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" + ) + ), + ] = None + status: Annotated[ + Optional[PersistentVolumeClaimStatus], + Field( + description=( + "Status represents the current information/status of a persistent" + " volume claim. Read-only. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" + ) + ), + ] = None -class EphemeralVolumeSource(BaseModel): - volume_claim_template: Optional[PersistentVolumeClaimTemplate] = Field( - default=None, - alias="volumeClaimTemplate", - description=( - "Will be used to create a stand-alone PVC to provision the volume. The pod" - " in which this EphemeralVolumeSource is embedded will be the owner of the" - " PVC, i.e. the PVC will be deleted together with the pod. The name of the" - " PVC will be `-` where `` is the name" - " from the `PodSpec.Volumes` array entry. Pod validation will reject the" - " pod if the concatenated name is not valid for a PVC (for example, too" - " long).\n\nAn existing PVC with that name that is not owned by the pod" - " will *not* be used for the pod to avoid using an unrelated volume by" - " mistake. Starting the pod is then blocked until the unrelated PVC is" - " removed. If such a pre-created PVC is meant to be used by the pod, the" - " PVC has to updated with an owner reference to the pod once the pod" - " exists. Normally this should not be necessary, but it may be useful when" - " manually reconstructing a broken cluster.\n\nThis field is read-only and" - " no changes will be made by Kubernetes to the PVC after it has been" - " created.\n\nRequired, must not be nil." - ), - ) +class PersistentVolumeClaimTemplate(BaseModel): + metadata: Annotated[ + Optional[v1.ObjectMeta], + Field( + description=( + "May contain labels and annotations that will be copied into the PVC" + " when creating it. No other fields are allowed and will be rejected" + " during validation." + ) + ), + ] = None + spec: Annotated[ + PersistentVolumeClaimSpec, + Field( + description=( + "The specification for the PersistentVolumeClaim. The entire content is" + " copied unchanged into the PVC that gets created from this template." + " The same fields as in a PersistentVolumeClaim are also valid here." + ) + ), + ] class Lifecycle(BaseModel): - post_start: Optional[LifecycleHandler] = Field( - default=None, - alias="postStart", - description=( - "PostStart is called immediately after a container is created. If the" - " handler fails, the container is terminated and restarted according to its" - " restart policy. Other management of the container blocks until the hook" - " completes. More info:" - " https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" - ), - ) - pre_stop: Optional[LifecycleHandler] = Field( - default=None, - alias="preStop", - description=( - "PreStop is called immediately before a container is terminated due to an" - " API request or management event such as liveness/startup probe failure," - " preemption, resource contention, etc. The handler is not called if the" - " container crashes or exits. The Pod's termination grace period countdown" - " begins before the PreStop hook is executed. Regardless of the outcome of" - " the handler, the container will eventually terminate within the Pod's" - " termination grace period (unless delayed by finalizers). Other management" - " of the container blocks until the hook completes or until the termination" - " grace period is reached. More info:" - " https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" - ), - ) + post_start: Annotated[ + Optional[LifecycleHandler], + Field( + alias="postStart", + description=( + "PostStart is called immediately after a container is created. If the" + " handler fails, the container is terminated and restarted according to" + " its restart policy. Other management of the container blocks until" + " the hook completes. More info:" + " https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" + ), + ), + ] = None + pre_stop: Annotated[ + Optional[LifecycleHandler], + Field( + alias="preStop", + description=( + "PreStop is called immediately before a container is terminated due to" + " an API request or management event such as liveness/startup probe" + " failure, preemption, resource contention, etc. The handler is not" + " called if the container crashes or exits. The Pod's termination grace" + " period countdown begins before the PreStop hook is executed." + " Regardless of the outcome of the handler, the container will" + " eventually terminate within the Pod's termination grace period" + " (unless delayed by finalizers). Other management of the container" + " blocks until the hook completes or until the termination grace period" + " is reached. More info:" + " https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" + ), + ), + ] = None -class PersistentVolumeClaim(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: Optional[v1.ObjectMeta] = Field( - default=None, - description=( - "Standard object's metadata. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - ), - ) - spec: Optional[PersistentVolumeClaimSpec] = Field( - default=None, - description=( - "Spec defines the desired characteristics of a volume requested by a pod" - " author. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - ), - ) - status: Optional[PersistentVolumeClaimStatus] = Field( - default=None, - description=( - "Status represents the current information/status of a persistent volume" - " claim. Read-only. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - ), - ) +class EphemeralVolumeSource(BaseModel): + volume_claim_template: Annotated[ + Optional[PersistentVolumeClaimTemplate], + Field( + alias="volumeClaimTemplate", + description=( + "Will be used to create a stand-alone PVC to provision the volume. The" + " pod in which this EphemeralVolumeSource is embedded will be the owner" + " of the PVC, i.e. the PVC will be deleted together with the pod. The" + " name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod" + " validation will reject the pod if the concatenated name is not valid" + " for a PVC (for example, too long).\n\nAn existing PVC with that name" + " that is not owned by the pod will *not* be used for the pod to avoid" + " using an unrelated volume by mistake. Starting the pod is then" + " blocked until the unrelated PVC is removed. If such a pre-created PVC" + " is meant to be used by the pod, the PVC has to updated with an owner" + " reference to the pod once the pod exists. Normally this should not be" + " necessary, but it may be useful when manually reconstructing a broken" + " cluster.\n\nThis field is read-only and no changes will be made by" + " Kubernetes to the PVC after it has been created.\n\nRequired, must" + " not be nil." + ), + ), + ] = None + + +class Container(BaseModel): + args: Annotated[ + Optional[List[str]], + Field( + description=( + "Arguments to the entrypoint. The docker image's CMD is used if this" + " is not provided. Variable references $(VAR_NAME) are expanded using" + " the container's environment. If a variable cannot be resolved, the" + " reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + " of whether the variable exists or not. Cannot be updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Entrypoint array. Not executed within a shell. The docker image's" + " ENTRYPOINT is used if this is not provided. Variable references" + " $(VAR_NAME) are expanded using the container's environment. If a" + " variable cannot be resolved, the reference in the input string will" + " be unchanged. Double $$ are reduced to a single $, which allows for" + ' escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the' + ' string literal "$(VAR_NAME)". Escaped references will never be' + " expanded, regardless of whether the variable exists or not. Cannot be" + " updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + env: Annotated[ + Optional[List[EnvVar]], + Field(description=("List of environment variables to set in the container. Cannot be" " updated.")), + ] = None + env_from: Annotated[ + Optional[List[EnvFromSource]], + Field( + alias="envFrom", + description=( + "List of sources to populate environment variables in the container." + " The keys defined within a source must be a C_IDENTIFIER. All invalid" + " keys will be reported as an event when the container is starting." + " When a key exists in multiple sources, the value associated with the" + " last source will take precedence. Values defined by an Env with a" + " duplicate key will take precedence. Cannot be updated." + ), + ), + ] = None + image: Annotated[ + str, + Field( + description=( + "Docker image name. More info:" + " https://kubernetes.io/docs/concepts/containers/images This field is" + " optional to allow higher level config management to default or" + " override container images in workload controllers like Deployments" + " and StatefulSets." + ) + ), + ] + image_pull_policy: Annotated[ + Optional[str], + Field( + alias="imagePullPolicy", + description=( + "Image pull policy. One of Always, Never, IfNotPresent. Defaults to" + " Always if :latest tag is specified, or IfNotPresent otherwise. Cannot" + " be updated. More info:" + " https://kubernetes.io/docs/concepts/containers/images#updating-images\n\nPossible" + ' enum values:\n - `"Always"` means that kubelet always attempts to' + " pull the latest image. Container will fail If the pull fails.\n -" + ' `"IfNotPresent"` means that kubelet pulls if the image isn\'t present' + " on disk. Container will fail if the image isn't present and the pull" + ' fails.\n - `"Never"` means that kubelet never pulls an image, but' + " only uses a local image. Container will fail if the image isn't" + " present" + ), + ), + ] = None + lifecycle: Annotated[ + Optional[Lifecycle], + Field( + description=( + "Actions that the management system should take in response to" + " container lifecycle events. Cannot be updated." + ) + ), + ] = None + liveness_probe: Annotated[ + Optional[Probe], + Field( + alias="livenessProbe", + description=( + "Periodic probe of container liveness. Container will be restarted if" + " the probe fails. Cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the container specified as a DNS_LABEL. Each container in a" + " pod must have a unique name (DNS_LABEL). Cannot be updated." + ) + ), + ] = None + ports: Annotated[ + Optional[List[ContainerPort]], + Field( + description=( + "List of ports to expose from the container. Exposing a port here gives" + " the system additional information about the network connections a" + " container uses, but is primarily informational. Not specifying a port" + " here DOES NOT prevent that port from being exposed. Any port which is" + ' listening on the default "0.0.0.0" address inside a container will be' + " accessible from the network. Cannot be updated." + ) + ), + ] = None + readiness_probe: Annotated[ + Optional[Probe], + Field( + alias="readinessProbe", + description=( + "Periodic probe of container service readiness. Container will be" + " removed from service endpoints if the probe fails. Cannot be updated." + " More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + resources: Annotated[ + Optional[ResourceRequirements], + Field( + description=( + "Compute Resources required by this container. Cannot be updated. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + security_context: Annotated[ + Optional[SecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext defines the security options the container should be" + " run with. If set, the fields of SecurityContext override the" + " equivalent fields of PodSecurityContext. More info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" + ), + ), + ] = None + startup_probe: Annotated[ + Optional[Probe], + Field( + alias="startupProbe", + description=( + "StartupProbe indicates that the Pod has successfully initialized. If" + " specified, no other probes are executed until this completes" + " successfully. If this probe fails, the Pod will be restarted, just as" + " if the livenessProbe failed. This can be used to provide different" + " probe parameters at the beginning of a Pod's lifecycle, when it might" + " take a long time to load data or warm a cache, than during" + " steady-state operation. This cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + stdin: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a buffer for stdin in the" + " container runtime. If this is not set, reads from stdin in the" + " container will always result in EOF. Default is false." + ) + ), + ] = None + stdin_once: Annotated[ + Optional[bool], + Field( + alias="stdinOnce", + description=( + "Whether the container runtime should close the stdin channel after it" + " has been opened by a single attach. When stdin is true the stdin" + " stream will remain open across multiple attach sessions. If stdinOnce" + " is set to true, stdin is opened on container start, is empty until" + " the first client attaches to stdin, and then remains open and accepts" + " data until the client disconnects, at which time stdin is closed and" + " remains closed until the container is restarted. If this flag is" + " false, a container processes that reads from stdin will never receive" + " an EOF. Default is false" + ), + ), + ] = None + termination_message_path: Annotated[ + Optional[str], + Field( + alias="terminationMessagePath", + description=( + "Optional: Path at which the file to which the container's termination" + " message will be written is mounted into the container's filesystem." + " Message written is intended to be brief final status, such as an" + " assertion failure message. Will be truncated by the node if greater" + " than 4096 bytes. The total message length across all containers will" + " be limited to 12kb. Defaults to /dev/termination-log. Cannot be" + " updated." + ), + ), + ] = None + termination_message_policy: Annotated[ + Optional[TerminationMessagePolicy], + Field( + alias="terminationMessagePolicy", + description=( + "Indicate how the termination message should be populated. File will" + " use the contents of terminationMessagePath to populate the container" + " status message on both success and failure. FallbackToLogsOnError" + " will use the last chunk of container log output if the termination" + " message file is empty and the container exited with an error. The log" + " output is limited to 2048 bytes or 80 lines, whichever is smaller." + " Defaults to File. Cannot be updated.\n\nPossible enum values:\n -" + ' `"FallbackToLogsOnError"` will read the most recent contents of the' + " container logs for the container status message when the container" + " exits with an error and the terminationMessagePath has no contents.\n" + ' - `"File"` is the default behavior and will set the container status' + " message to the contents of the container's terminationMessagePath" + " when the container exits." + ), + ), + ] = None + tty: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a TTY for itself, also requires" + " 'stdin' to be true. Default is false." + ) + ), + ] = None + volume_devices: Annotated[ + Optional[List[VolumeDevice]], + Field( + alias="volumeDevices", + description=("volumeDevices is the list of block devices to be used by the" " container."), + ), + ] = None + volume_mounts: Annotated[ + Optional[List[VolumeMount]], + Field( + alias="volumeMounts", + description=("Pod volumes to mount into the container's filesystem. Cannot be" " updated."), + ), + ] = None + working_dir: Annotated[ + Optional[str], + Field( + alias="workingDir", + description=( + "Container's working directory. If not specified, the container" + " runtime's default will be used, which might be configured in the" + " container image. Cannot be updated." + ), + ), + ] = None class PodAffinity(BaseModel): - preferred_during_scheduling_ignored_during_execution: Optional[List[WeightedPodAffinityTerm]] = Field( - default=None, - alias="preferredDuringSchedulingIgnoredDuringExecution", - description=( - "The scheduler will prefer to schedule pods to nodes that satisfy the" - " affinity expressions specified by this field, but it may choose a node" - " that violates one or more of the expressions. The node that is most" - " preferred is the one with the greatest sum of weights, i.e. for each node" - " that meets all of the scheduling requirements (resource request," - " requiredDuringScheduling affinity expressions, etc.), compute a sum by" - ' iterating through the elements of this field and adding "weight" to the' - " sum if the node has pods which matches the corresponding podAffinityTerm;" - " the node(s) with the highest sum are the most preferred." - ), - ) - required_during_scheduling_ignored_during_execution: Optional[List[PodAffinityTerm]] = Field( - default=None, - alias="requiredDuringSchedulingIgnoredDuringExecution", - description=( - "If the affinity requirements specified by this field are not met at" - " scheduling time, the pod will not be scheduled onto the node. If the" - " affinity requirements specified by this field cease to be met at some" - " point during pod execution (e.g. due to a pod label update), the system" - " may or may not try to eventually evict the pod from its node. When there" - " are multiple elements, the lists of nodes corresponding to each" - " podAffinityTerm are intersected, i.e. all terms must be satisfied." - ), - ) + preferred_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[WeightedPodAffinityTerm]], + Field( + alias="preferredDuringSchedulingIgnoredDuringExecution", + description=( + "The scheduler will prefer to schedule pods to nodes that satisfy the" + " affinity expressions specified by this field, but it may choose a" + " node that violates one or more of the expressions. The node that is" + " most preferred is the one with the greatest sum of weights, i.e. for" + " each node that meets all of the scheduling requirements (resource" + " request, requiredDuringScheduling affinity expressions, etc.)," + " compute a sum by iterating through the elements of this field and" + ' adding "weight" to the sum if the node has pods which matches the' + " corresponding podAffinityTerm; the node(s) with the highest sum are" + " the most preferred." + ), + ), + ] = None + required_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[PodAffinityTerm]], + Field( + alias="requiredDuringSchedulingIgnoredDuringExecution", + description=( + "If the affinity requirements specified by this field are not met at" + " scheduling time, the pod will not be scheduled onto the node. If the" + " affinity requirements specified by this field cease to be met at some" + " point during pod execution (e.g. due to a pod label update), the" + " system may or may not try to eventually evict the pod from its node." + " When there are multiple elements, the lists of nodes corresponding to" + " each podAffinityTerm are intersected, i.e. all terms must be" + " satisfied." + ), + ), + ] = None class PodAntiAffinity(BaseModel): - preferred_during_scheduling_ignored_during_execution: Optional[List[WeightedPodAffinityTerm]] = Field( - default=None, - alias="preferredDuringSchedulingIgnoredDuringExecution", - description=( - "The scheduler will prefer to schedule pods to nodes that satisfy the" - " anti-affinity expressions specified by this field, but it may choose a" - " node that violates one or more of the expressions. The node that is most" - " preferred is the one with the greatest sum of weights, i.e. for each node" - " that meets all of the scheduling requirements (resource request," - " requiredDuringScheduling anti-affinity expressions, etc.), compute a sum" - ' by iterating through the elements of this field and adding "weight" to' - " the sum if the node has pods which matches the corresponding" - " podAffinityTerm; the node(s) with the highest sum are the most preferred." - ), - ) - required_during_scheduling_ignored_during_execution: Optional[List[PodAffinityTerm]] = Field( - default=None, - alias="requiredDuringSchedulingIgnoredDuringExecution", - description=( - "If the anti-affinity requirements specified by this field are not met at" - " scheduling time, the pod will not be scheduled onto the node. If the" - " anti-affinity requirements specified by this field cease to be met at" - " some point during pod execution (e.g. due to a pod label update), the" - " system may or may not try to eventually evict the pod from its node. When" - " there are multiple elements, the lists of nodes corresponding to each" - " podAffinityTerm are intersected, i.e. all terms must be satisfied." - ), - ) + preferred_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[WeightedPodAffinityTerm]], + Field( + alias="preferredDuringSchedulingIgnoredDuringExecution", + description=( + "The scheduler will prefer to schedule pods to nodes that satisfy the" + " anti-affinity expressions specified by this field, but it may choose" + " a node that violates one or more of the expressions. The node that is" + " most preferred is the one with the greatest sum of weights, i.e. for" + " each node that meets all of the scheduling requirements (resource" + " request, requiredDuringScheduling anti-affinity expressions, etc.)," + " compute a sum by iterating through the elements of this field and" + ' adding "weight" to the sum if the node has pods which matches the' + " corresponding podAffinityTerm; the node(s) with the highest sum are" + " the most preferred." + ), + ), + ] = None + required_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[PodAffinityTerm]], + Field( + alias="requiredDuringSchedulingIgnoredDuringExecution", + description=( + "If the anti-affinity requirements specified by this field are not met" + " at scheduling time, the pod will not be scheduled onto the node. If" + " the anti-affinity requirements specified by this field cease to be" + " met at some point during pod execution (e.g. due to a pod label" + " update), the system may or may not try to eventually evict the pod" + " from its node. When there are multiple elements, the lists of nodes" + " corresponding to each podAffinityTerm are intersected, i.e. all terms" + " must be satisfied." + ), + ), + ] = None -class VolumeProjection(BaseModel): - config_map: Optional[ConfigMapProjection] = Field( - default=None, - alias="configMap", - description="information about the configMap data to project", - ) - downward_api: Optional[DownwardAPIProjection] = Field( - default=None, - alias="downwardAPI", - description="information about the downwardAPI data to project", - ) - secret: Optional[SecretProjection] = Field( - default=None, description="information about the secret data to project" - ) - service_account_token: Optional[ServiceAccountTokenProjection] = Field( - default=None, - alias="serviceAccountToken", - description="information about the serviceAccountToken data to project", - ) +class ProjectedVolumeSource(BaseModel): + default_mode: Annotated[ + Optional[int], + Field( + alias="defaultMode", + description=( + "Mode bits used to set permissions on created files by default. Must be" + " an octal value between 0000 and 0777 or a decimal value between 0 and" + " 511. YAML accepts both octal and decimal values, JSON requires" + " decimal values for mode bits. Directories within the path are not" + " affected by this setting. This might be in conflict with other" + " options that affect the file mode, like fsGroup, and the result can" + " be other mode bits set." + ), + ), + ] = None + sources: Annotated[ + Optional[List[VolumeProjection]], + Field(description="list of volume projections"), + ] = None class Affinity(BaseModel): - node_affinity: Optional[NodeAffinity] = Field( - default=None, - alias="nodeAffinity", - description="Describes node affinity scheduling rules for the pod.", - ) - pod_affinity: Optional[PodAffinity] = Field( - default=None, - alias="podAffinity", - description=( - "Describes pod affinity scheduling rules (e.g. co-locate this pod in the" - " same node, zone, etc. as some other pod(s))." - ), - ) - pod_anti_affinity: Optional[PodAntiAffinity] = Field( - default=None, - alias="podAntiAffinity", - description=( - "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod" - " in the same node, zone, etc. as some other pod(s))." - ), - ) - - -class Container(BaseModel): - args: Optional[List[str]] = Field( - default=None, - description=( - "Arguments to the entrypoint. The docker image's CMD is used if this is" - " not provided. Variable references $(VAR_NAME) are expanded using the" - " container's environment. If a variable cannot be resolved, the reference" - " in the input string will be unchanged. Double $$ are reduced to a single" - ' $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)"' - ' will produce the string literal "$(VAR_NAME)". Escaped references will' - " never be expanded, regardless of whether the variable exists or not." - " Cannot be updated. More info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - command: Optional[List[str]] = Field( - default=None, - description=( - "Entrypoint array. Not executed within a shell. The docker image's" - " ENTRYPOINT is used if this is not provided. Variable references" - " $(VAR_NAME) are expanded using the container's environment. If a" - " variable cannot be resolved, the reference in the input string will be" - " unchanged. Double $$ are reduced to a single $, which allows for escaping" - ' the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string' - ' literal "$(VAR_NAME)". Escaped references will never be expanded,' - " regardless of whether the variable exists or not. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - env: Optional[List[EnvVar]] = Field( - default=None, - description=("List of environment variables to set in the container. Cannot be updated."), - ) - env_from: Optional[List[EnvFromSource]] = Field( - default=None, - alias="envFrom", - description=( - "List of sources to populate environment variables in the container. The" - " keys defined within a source must be a C_IDENTIFIER. All invalid keys" - " will be reported as an event when the container is starting. When a key" - " exists in multiple sources, the value associated with the last source" - " will take precedence. Values defined by an Env with a duplicate key will" - " take precedence. Cannot be updated." - ), - ) - image: str = Field( - ..., - description=( - "Docker image name. More info:" - " https://kubernetes.io/docs/concepts/containers/images This field is" - " optional to allow higher level config management to default or override" - " container images in workload controllers like Deployments and" - " StatefulSets." - ), - ) - image_pull_policy: Optional[str] = Field( - default=None, - alias="imagePullPolicy", - description=( - "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always" - " if :latest tag is specified, or IfNotPresent otherwise. Cannot be" - " updated. More info:" - " https://kubernetes.io/docs/concepts/containers/images#updating-images\n\nPossible" - ' enum values:\n - `"Always"` means that kubelet always attempts to pull' - " the latest image. Container will fail If the pull fails.\n -" - ' `"IfNotPresent"` means that kubelet pulls if the image isn\'t present on' - " disk. Container will fail if the image isn't present and the pull" - ' fails.\n - `"Never"` means that kubelet never pulls an image, but only' - " uses a local image. Container will fail if the image isn't present" - ), - ) - lifecycle: Optional[Lifecycle] = Field( - default=None, - description=( - "Actions that the management system should take in response to container" - " lifecycle events. Cannot be updated." - ), - ) - liveness_probe: Optional[Probe] = Field( - default=None, - alias="livenessProbe", - description=( - "Periodic probe of container liveness. Container will be restarted if the" - " probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the container specified as a DNS_LABEL. Each container in a pod" - " must have a unique name (DNS_LABEL). Cannot be updated." - ), - ) - ports: Optional[List[ContainerPort]] = Field( - default=None, - description=( - "List of ports to expose from the container. Exposing a port here gives the" - " system additional information about the network connections a container" - " uses, but is primarily informational. Not specifying a port here DOES NOT" - " prevent that port from being exposed. Any port which is listening on the" - ' default "0.0.0.0" address inside a container will be accessible from the' - " network. Cannot be updated." - ), - ) - readiness_probe: Optional[Probe] = Field( - default=None, - alias="readinessProbe", - description=( - "Periodic probe of container service readiness. Container will be removed" - " from service endpoints if the probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - resources: Optional[ResourceRequirements] = Field( - default=None, - description=( - "Compute Resources required by this container. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - security_context: Optional[SecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext defines the security options the container should be run" - " with. If set, the fields of SecurityContext override the equivalent" - " fields of PodSecurityContext. More info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" - ), - ) - startup_probe: Optional[Probe] = Field( - default=None, - alias="startupProbe", - description=( - "StartupProbe indicates that the Pod has successfully initialized. If" - " specified, no other probes are executed until this completes" - " successfully. If this probe fails, the Pod will be restarted, just as if" - " the livenessProbe failed. This can be used to provide different probe" - " parameters at the beginning of a Pod's lifecycle, when it might take a" - " long time to load data or warm a cache, than during steady-state" - " operation. This cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - stdin: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a buffer for stdin in the container" - " runtime. If this is not set, reads from stdin in the container will" - " always result in EOF. Default is false." - ), - ) - stdin_once: Optional[bool] = Field( - default=None, - alias="stdinOnce", - description=( - "Whether the container runtime should close the stdin channel after it has" - " been opened by a single attach. When stdin is true the stdin stream will" - " remain open across multiple attach sessions. If stdinOnce is set to true," - " stdin is opened on container start, is empty until the first client" - " attaches to stdin, and then remains open and accepts data until the" - " client disconnects, at which time stdin is closed and remains closed" - " until the container is restarted. If this flag is false, a container" - " processes that reads from stdin will never receive an EOF. Default is" - " false" - ), - ) - termination_message_path: Optional[str] = Field( - default=None, - alias="terminationMessagePath", - description=( - "Optional: Path at which the file to which the container's termination" - " message will be written is mounted into the container's filesystem." - " Message written is intended to be brief final status, such as an" - " assertion failure message. Will be truncated by the node if greater than" - " 4096 bytes. The total message length across all containers will be" - " limited to 12kb. Defaults to /dev/termination-log. Cannot be updated." - ), - ) - termination_message_policy: Optional[TerminationMessagePolicy] = Field( - default=None, - alias="terminationMessagePolicy", - description=( - "Indicate how the termination message should be populated. File will use" - " the contents of terminationMessagePath to populate the container status" - " message on both success and failure. FallbackToLogsOnError will use the" - " last chunk of container log output if the termination message file is" - " empty and the container exited with an error. The log output is limited" - " to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot" - ' be updated.\n\nPossible enum values:\n - `"FallbackToLogsOnError"` will' - " read the most recent contents of the container logs for the container" - " status message when the container exits with an error and the" - ' terminationMessagePath has no contents.\n - `"File"` is the default' - " behavior and will set the container status message to the contents of the" - " container's terminationMessagePath when the container exits." - ), - ) - tty: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a TTY for itself, also requires" - " 'stdin' to be true. Default is false." - ), - ) - volume_devices: Optional[List[VolumeDevice]] = Field( - default=None, - alias="volumeDevices", - description=("volumeDevices is the list of block devices to be used by the container."), - ) - volume_mounts: Optional[List[VolumeMount]] = Field( - default=None, - alias="volumeMounts", - description=("Pod volumes to mount into the container's filesystem. Cannot be updated."), - ) - working_dir: Optional[str] = Field( - default=None, - alias="workingDir", - description=( - "Container's working directory. If not specified, the container runtime's" - " default will be used, which might be configured in the container image." - " Cannot be updated." - ), - ) - - -class ProjectedVolumeSource(BaseModel): - default_mode: Optional[int] = Field( - default=None, - alias="defaultMode", - description=( - "Mode bits used to set permissions on created files by default. Must be an" - " octal value between 0000 and 0777 or a decimal value between 0 and 511." - " YAML accepts both octal and decimal values, JSON requires decimal values" - " for mode bits. Directories within the path are not affected by this" - " setting. This might be in conflict with other options that affect the" - " file mode, like fsGroup, and the result can be other mode bits set." - ), - ) - sources: Optional[List[VolumeProjection]] = Field(default=None, description="list of volume projections") + node_affinity: Annotated[ + Optional[NodeAffinity], + Field( + alias="nodeAffinity", + description="Describes node affinity scheduling rules for the pod.", + ), + ] = None + pod_affinity: Annotated[ + Optional[PodAffinity], + Field( + alias="podAffinity", + description=( + "Describes pod affinity scheduling rules (e.g. co-locate this pod in" + " the same node, zone, etc. as some other pod(s))." + ), + ), + ] = None + pod_anti_affinity: Annotated[ + Optional[PodAntiAffinity], + Field( + alias="podAntiAffinity", + description=( + "Describes pod anti-affinity scheduling rules (e.g. avoid putting this" + " pod in the same node, zone, etc. as some other pod(s))." + ), + ), + ] = None class Volume(BaseModel): - aws_elastic_block_store: Optional[AWSElasticBlockStoreVolumeSource] = Field( - default=None, - alias="awsElasticBlockStore", - description=( - "AWSElasticBlockStore represents an AWS Disk resource that is attached to a" - " kubelet's host machine and then exposed to the pod. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - ), - ) - azure_disk: Optional[AzureDiskVolumeSource] = Field( - default=None, - alias="azureDisk", - description=("AzureDisk represents an Azure Data Disk mount on the host and bind mount" " to the pod."), - ) - azure_file: Optional[AzureFileVolumeSource] = Field( - default=None, - alias="azureFile", - description=("AzureFile represents an Azure File Service mount on the host and bind" " mount to the pod."), - ) - cephfs: Optional[CephFSVolumeSource] = Field( - default=None, - description=("CephFS represents a Ceph FS mount on the host that shares a pod's lifetime"), - ) - cinder: Optional[CinderVolumeSource] = Field( - default=None, - description=( - "Cinder represents a cinder volume attached and mounted on kubelets host" - " machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" - ), - ) - config_map: Optional[ConfigMapVolumeSource] = Field( - default=None, - alias="configMap", - description="ConfigMap represents a configMap that should populate this volume", - ) - csi: Optional[CSIVolumeSource] = Field( - default=None, - description=( - "CSI (Container Storage Interface) represents ephemeral storage that is" - " handled by certain external CSI drivers (Beta feature)." - ), - ) - downward_api: Optional[DownwardAPIVolumeSource] = Field( - default=None, - alias="downwardAPI", - description=("DownwardAPI represents downward API about the pod that should populate" " this volume"), - ) - empty_dir: Optional[EmptyDirVolumeSource] = Field( - default=None, - alias="emptyDir", - description=( - "EmptyDir represents a temporary directory that shares a pod's lifetime." - " More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" - ), - ) - ephemeral: Optional[EphemeralVolumeSource] = Field( - default=None, - description=( - "Ephemeral represents a volume that is handled by a cluster storage driver." - " The volume's lifecycle is tied to the pod that defines it - it will be" - " created before the pod starts, and deleted when the pod is" - " removed.\n\nUse this if: a) the volume is only needed while the pod runs," - " b) features of normal volumes like restoring from snapshot or capacity\n " - " tracking are needed,\nc) the storage driver is specified through a" - " storage class, and d) the storage driver supports dynamic volume" - " provisioning through\n a PersistentVolumeClaim (see" - " EphemeralVolumeSource for more\n information on the connection between" - " this volume type\n and PersistentVolumeClaim).\n\nUse" - " PersistentVolumeClaim or one of the vendor-specific APIs for volumes that" - " persist for longer than the lifecycle of an individual pod.\n\nUse CSI" - " for light-weight local ephemeral volumes if the CSI driver is meant to be" - " used that way - see the documentation of the driver for more" - " information.\n\nA pod can use both types of ephemeral volumes and" - " persistent volumes at the same time." - ), - ) - fc: Optional[FCVolumeSource] = Field( - default=None, - description=( - "FC represents a Fibre Channel resource that is attached to a kubelet's" - " host machine and then exposed to the pod." - ), - ) - flex_volume: Optional[FlexVolumeSource] = Field( - default=None, - alias="flexVolume", - description=( - "FlexVolume represents a generic volume resource that is" - " provisioned/attached using an exec based plugin." - ), - ) - flocker: Optional[FlockerVolumeSource] = Field( - default=None, - description=( - "Flocker represents a Flocker volume attached to a kubelet's host machine." - " This depends on the Flocker control service being running" - ), - ) - gce_persistent_disk: Optional[GCEPersistentDiskVolumeSource] = Field( - default=None, - alias="gcePersistentDisk", - description=( - "GCEPersistentDisk represents a GCE Disk resource that is attached to a" - " kubelet's host machine and then exposed to the pod. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) - git_repo: Optional[GitRepoVolumeSource] = Field( - default=None, - alias="gitRepo", - description=( - "GitRepo represents a git repository at a particular revision. DEPRECATED:" - " GitRepo is deprecated. To provision a container with a git repo, mount an" - " EmptyDir into an InitContainer that clones the repo using git, then mount" - " the EmptyDir into the Pod's container." - ), - ) - glusterfs: Optional[GlusterfsVolumeSource] = Field( - default=None, - description=( - "Glusterfs represents a Glusterfs mount on the host that shares a pod's" - " lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md" - ), - ) - host_path: Optional[HostPathVolumeSource] = Field( - default=None, - alias="hostPath", - description=( - "HostPath represents a pre-existing file or directory on the host machine" - " that is directly exposed to the container. This is generally used for" - " system agents or other privileged things that are allowed to see the host" - " machine. Most containers will NOT need this. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" - ), - ) - iscsi: Optional[ISCSIVolumeSource] = Field( - default=None, - description=( - "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's" - " host machine and then exposed to the pod. More info:" - " https://examples.k8s.io/volumes/iscsi/README.md" - ), - ) - name: str = Field( - ..., - description=( - "Volume's name. Must be a DNS_LABEL and unique within the pod. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - nfs: Optional[NFSVolumeSource] = Field( - default=None, - description=( - "NFS represents an NFS mount on the host that shares a pod's lifetime More" - " info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" - ), - ) - persistent_volume_claim: Optional[PersistentVolumeClaimVolumeSource] = Field( - default=None, - alias="persistentVolumeClaim", - description=( - "PersistentVolumeClaimVolumeSource represents a reference to a" - " PersistentVolumeClaim in the same namespace. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - ), - ) - photon_persistent_disk: Optional[PhotonPersistentDiskVolumeSource] = Field( - default=None, - alias="photonPersistentDisk", - description=( - "PhotonPersistentDisk represents a PhotonController persistent disk" - " attached and mounted on kubelets host machine" - ), - ) - portworx_volume: Optional[PortworxVolumeSource] = Field( - default=None, - alias="portworxVolume", - description=("PortworxVolume represents a portworx volume attached and mounted on" " kubelets host machine"), - ) - projected: Optional[ProjectedVolumeSource] = Field( - default=None, - description=("Items for all in one resources secrets, configmaps, and downward API"), - ) - quobyte: Optional[QuobyteVolumeSource] = Field( - default=None, - description=("Quobyte represents a Quobyte mount on the host that shares a pod's" " lifetime"), - ) - rbd: Optional[RBDVolumeSource] = Field( - default=None, - description=( - "RBD represents a Rados Block Device mount on the host that shares a pod's" - " lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md" - ), - ) - scale_io: Optional[ScaleIOVolumeSource] = Field( - default=None, - alias="scaleIO", - description=("ScaleIO represents a ScaleIO persistent volume attached and mounted on" " Kubernetes nodes."), - ) - secret: Optional[SecretVolumeSource] = Field( - default=None, - description=( - "Secret represents a secret that should populate this volume. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#secret" - ), - ) - storageos: Optional[StorageOSVolumeSource] = Field( - default=None, - description=("StorageOS represents a StorageOS volume attached and mounted on Kubernetes" " nodes."), - ) - vsphere_volume: Optional[VsphereVirtualDiskVolumeSource] = Field( - default=None, - alias="vsphereVolume", - description=("VsphereVolume represents a vSphere volume attached and mounted on kubelets" " host machine"), - ) + aws_elastic_block_store: Annotated[ + Optional[AWSElasticBlockStoreVolumeSource], + Field( + alias="awsElasticBlockStore", + description=( + "AWSElasticBlockStore represents an AWS Disk resource that is attached" + " to a kubelet's host machine and then exposed to the pod. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + ), + ), + ] = None + azure_disk: Annotated[ + Optional[AzureDiskVolumeSource], + Field( + alias="azureDisk", + description=("AzureDisk represents an Azure Data Disk mount on the host and bind" " mount to the pod."), + ), + ] = None + azure_file: Annotated[ + Optional[AzureFileVolumeSource], + Field( + alias="azureFile", + description=("AzureFile represents an Azure File Service mount on the host and bind" " mount to the pod."), + ), + ] = None + cephfs: Annotated[ + Optional[CephFSVolumeSource], + Field(description=("CephFS represents a Ceph FS mount on the host that shares a pod's" " lifetime")), + ] = None + cinder: Annotated[ + Optional[CinderVolumeSource], + Field( + description=( + "Cinder represents a cinder volume attached and mounted on kubelets" + " host machine. More info:" + " https://examples.k8s.io/mysql-cinder-pd/README.md" + ) + ), + ] = None + config_map: Annotated[ + Optional[ConfigMapVolumeSource], + Field( + alias="configMap", + description=("ConfigMap represents a configMap that should populate this volume"), + ), + ] = None + csi: Annotated[ + Optional[CSIVolumeSource], + Field( + description=( + "CSI (Container Storage Interface) represents ephemeral storage that is" + " handled by certain external CSI drivers (Beta feature)." + ) + ), + ] = None + downward_api: Annotated[ + Optional[DownwardAPIVolumeSource], + Field( + alias="downwardAPI", + description=("DownwardAPI represents downward API about the pod that should populate" " this volume"), + ), + ] = None + empty_dir: Annotated[ + Optional[EmptyDirVolumeSource], + Field( + alias="emptyDir", + description=( + "EmptyDir represents a temporary directory that shares a pod's" + " lifetime. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#emptydir" + ), + ), + ] = None + ephemeral: Annotated[ + Optional[EphemeralVolumeSource], + Field( + description=( + "Ephemeral represents a volume that is handled by a cluster storage" + " driver. The volume's lifecycle is tied to the pod that defines it -" + " it will be created before the pod starts, and deleted when the pod is" + " removed.\n\nUse this if: a) the volume is only needed while the pod" + " runs, b) features of normal volumes like restoring from snapshot or" + " capacity\n tracking are needed,\nc) the storage driver is specified" + " through a storage class, and d) the storage driver supports dynamic" + " volume provisioning through\n a PersistentVolumeClaim (see" + " EphemeralVolumeSource for more\n information on the connection" + " between this volume type\n and PersistentVolumeClaim).\n\nUse" + " PersistentVolumeClaim or one of the vendor-specific APIs for volumes" + " that persist for longer than the lifecycle of an individual" + " pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI" + " driver is meant to be used that way - see the documentation of the" + " driver for more information.\n\nA pod can use both types of ephemeral" + " volumes and persistent volumes at the same time." + ) + ), + ] = None + fc: Annotated[ + Optional[FCVolumeSource], + Field( + description=( + "FC represents a Fibre Channel resource that is attached to a kubelet's" + " host machine and then exposed to the pod." + ) + ), + ] = None + flex_volume: Annotated[ + Optional[FlexVolumeSource], + Field( + alias="flexVolume", + description=( + "FlexVolume represents a generic volume resource that is" + " provisioned/attached using an exec based plugin." + ), + ), + ] = None + flocker: Annotated[ + Optional[FlockerVolumeSource], + Field( + description=( + "Flocker represents a Flocker volume attached to a kubelet's host" + " machine. This depends on the Flocker control service being running" + ) + ), + ] = None + gce_persistent_disk: Annotated[ + Optional[GCEPersistentDiskVolumeSource], + Field( + alias="gcePersistentDisk", + description=( + "GCEPersistentDisk represents a GCE Disk resource that is attached to a" + " kubelet's host machine and then exposed to the pod. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ), + ), + ] = None + git_repo: Annotated[ + Optional[GitRepoVolumeSource], + Field( + alias="gitRepo", + description=( + "GitRepo represents a git repository at a particular revision." + " DEPRECATED: GitRepo is deprecated. To provision a container with a" + " git repo, mount an EmptyDir into an InitContainer that clones the" + " repo using git, then mount the EmptyDir into the Pod's container." + ), + ), + ] = None + glusterfs: Annotated[ + Optional[GlusterfsVolumeSource], + Field( + description=( + "Glusterfs represents a Glusterfs mount on the host that shares a pod's" + " lifetime. More info:" + " https://examples.k8s.io/volumes/glusterfs/README.md" + ) + ), + ] = None + host_path: Annotated[ + Optional[HostPathVolumeSource], + Field( + alias="hostPath", + description=( + "HostPath represents a pre-existing file or directory on the host" + " machine that is directly exposed to the container. This is generally" + " used for system agents or other privileged things that are allowed to" + " see the host machine. Most containers will NOT need this. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" + ), + ), + ] = None + iscsi: Annotated[ + Optional[ISCSIVolumeSource], + Field( + description=( + "ISCSI represents an ISCSI Disk resource that is attached to a" + " kubelet's host machine and then exposed to the pod. More info:" + " https://examples.k8s.io/volumes/iscsi/README.md" + ) + ), + ] = None + name: Annotated[ + str, + Field( + description=( + "Volume's name. Must be a DNS_LABEL and unique within the pod. More" + " info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] + nfs: Annotated[ + Optional[NFSVolumeSource], + Field( + description=( + "NFS represents an NFS mount on the host that shares a pod's lifetime" + " More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" + ) + ), + ] = None + persistent_volume_claim: Annotated[ + Optional[PersistentVolumeClaimVolumeSource], + Field( + alias="persistentVolumeClaim", + description=( + "PersistentVolumeClaimVolumeSource represents a reference to a" + " PersistentVolumeClaim in the same namespace. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" + ), + ), + ] = None + photon_persistent_disk: Annotated[ + Optional[PhotonPersistentDiskVolumeSource], + Field( + alias="photonPersistentDisk", + description=( + "PhotonPersistentDisk represents a PhotonController persistent disk" + " attached and mounted on kubelets host machine" + ), + ), + ] = None + portworx_volume: Annotated[ + Optional[PortworxVolumeSource], + Field( + alias="portworxVolume", + description=( + "PortworxVolume represents a portworx volume attached and mounted on" " kubelets host machine" + ), + ), + ] = None + projected: Annotated[ + Optional[ProjectedVolumeSource], + Field(description=("Items for all in one resources secrets, configmaps, and downward API")), + ] = None + quobyte: Annotated[ + Optional[QuobyteVolumeSource], + Field(description=("Quobyte represents a Quobyte mount on the host that shares a pod's" " lifetime")), + ] = None + rbd: Annotated[ + Optional[RBDVolumeSource], + Field( + description=( + "RBD represents a Rados Block Device mount on the host that shares a" + " pod's lifetime. More info:" + " https://examples.k8s.io/volumes/rbd/README.md" + ) + ), + ] = None + scale_io: Annotated[ + Optional[ScaleIOVolumeSource], + Field( + alias="scaleIO", + description=( + "ScaleIO represents a ScaleIO persistent volume attached and mounted on" " Kubernetes nodes." + ), + ), + ] = None + secret: Annotated[ + Optional[SecretVolumeSource], + Field( + description=( + "Secret represents a secret that should populate this volume. More" + " info: https://kubernetes.io/docs/concepts/storage/volumes#secret" + ) + ), + ] = None + storageos: Annotated[ + Optional[StorageOSVolumeSource], + Field(description=("StorageOS represents a StorageOS volume attached and mounted on" " Kubernetes nodes.")), + ] = None + vsphere_volume: Annotated[ + Optional[VsphereVirtualDiskVolumeSource], + Field( + alias="vsphereVolume", + description=("VsphereVolume represents a vSphere volume attached and mounted on" " kubelets host machine"), + ), + ] = None diff --git a/src/hera/events/models/io/k8s/api/policy/v1beta1.py b/src/hera/events/models/io/k8s/api/policy/v1beta1.py index 3df7c5731..5c81ecedd 100644 --- a/src/hera/events/models/io/k8s/api/policy/v1beta1.py +++ b/src/hera/events/models/io/k8s/api/policy/v1beta1.py @@ -5,6 +5,8 @@ from typing import Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from ...apimachinery.pkg.apis.meta import v1 @@ -12,33 +14,40 @@ class PodDisruptionBudgetSpec(BaseModel): - max_unavailable: Optional[intstr.IntOrString] = Field( - default=None, - alias="maxUnavailable", - description=( - 'An eviction is allowed if at most "maxUnavailable" pods selected by' - ' "selector" are unavailable after the eviction, i.e. even in absence of' - " the evicted pod. For example, one can prevent all voluntary evictions by" - ' specifying 0. This is a mutually exclusive setting with "minAvailable".' + max_unavailable: Annotated[ + Optional[intstr.IntOrString], + Field( + alias="maxUnavailable", + description=( + 'An eviction is allowed if at most "maxUnavailable" pods selected by' + ' "selector" are unavailable after the eviction, i.e. even in absence' + " of the evicted pod. For example, one can prevent all voluntary" + " evictions by specifying 0. This is a mutually exclusive setting with" + ' "minAvailable".' + ), ), - ) - min_available: Optional[intstr.IntOrString] = Field( - default=None, - alias="minAvailable", - description=( - 'An eviction is allowed if at least "minAvailable" pods selected by' - ' "selector" will still be available after the eviction, i.e. even in the' - " absence of the evicted pod. So for example you can prevent all voluntary" - ' evictions by specifying "100%".' + ] = None + min_available: Annotated[ + Optional[intstr.IntOrString], + Field( + alias="minAvailable", + description=( + 'An eviction is allowed if at least "minAvailable" pods selected by' + ' "selector" will still be available after the eviction, i.e. even in' + " the absence of the evicted pod. So for example you can prevent all" + ' voluntary evictions by specifying "100%".' + ), ), - ) - selector: Optional[v1.LabelSelector] = Field( - default=None, - description=( - "Label query over pods whose evictions are managed by the disruption" - " budget. A null selector selects no pods. An empty selector ({}) also" - " selects no pods, which differs from standard behavior of selecting all" - " pods. In policy/v1, an empty selector will select all pods in the" - " namespace." + ] = None + selector: Annotated[ + Optional[v1.LabelSelector], + Field( + description=( + "Label query over pods whose evictions are managed by the disruption" + " budget. A null selector selects no pods. An empty selector ({}) also" + " selects no pods, which differs from standard behavior of selecting" + " all pods. In policy/v1, an empty selector will select all pods in the" + " namespace." + ) ), - ) + ] = None diff --git a/src/hera/events/models/io/k8s/apimachinery/pkg/api/resource.py b/src/hera/events/models/io/k8s/apimachinery/pkg/api/resource.py index d5ac8d261..8df184a1c 100644 --- a/src/hera/events/models/io/k8s/apimachinery/pkg/api/resource.py +++ b/src/hera/events/models/io/k8s/apimachinery/pkg/api/resource.py @@ -3,48 +3,53 @@ from __future__ import annotations +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field class Quantity(BaseModel): - __root__: str = Field( - ..., - description=( - "Quantity is a fixed-point representation of a number. It provides" - " convenient marshaling/unmarshaling in JSON and YAML, in addition to" - " String() and AsInt64() accessors.\n\nThe serialization format" - " is:\n\n ::= \n (Note that" - ' may be empty, from the "" case in .)\n ' - " ::= 0 | 1 | ... | 9 ::= | " - " ::= | . | . |" - ' . ::= "+" | "-" ::= ' - " | ::= | |" - " ::= Ki | Mi | Gi | Ti | Pi | Ei\n " - " (International System of units; See:" - " http://physics.nist.gov/cuu/Units/binary.html)\n ::= m |" - ' "" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I' - ' didn\'t choose the capitalization.)\n ::= "e"' - ' | "E" \n\nNo matter which of the three' - " exponent forms is used, no quantity may represent a number greater than" - " 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers" - " larger or more precise will be capped or rounded up. (E.g.: 0.1m will" - " rounded up to 1m.) This may be extended in the future if we require" - " larger or smaller quantities.\n\nWhen a Quantity is parsed from a string," - " it will remember the type of suffix it had, and will use the same type" - " again when it is serialized.\n\nBefore serializing, Quantity will be put" - ' in "canonical form". This means that Exponent/suffix will be adjusted up' - " or down (with a corresponding increase or decrease in Mantissa) such" - " that:\n a. No precision is lost\n b. No fractional digits will be" - " emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign" - " will be omitted unless the number is negative.\n\nExamples:\n 1.5 will" - ' be serialized as "1500m"\n 1.5Gi will be serialized as "1536Mi"\n\nNote' - " that the quantity will NEVER be internally represented by a floating" - " point number. That is the whole point of this exercise.\n\nNon-canonical" - " values will still parse as long as they are well formed, but will be" - " re-emitted in their canonical form. (So always use canonical form, or" - " don't diff.)\n\nThis format is intended to make it difficult to use" - " these numbers without writing some sort of special handling code in the" - " hopes that that will cause implementors to also use a fixed point" - " implementation." + __root__: Annotated[ + str, + Field( + description=( + "Quantity is a fixed-point representation of a number. It provides" + " convenient marshaling/unmarshaling in JSON and YAML, in addition to" + " String() and AsInt64() accessors.\n\nThe serialization format" + " is:\n\n ::= \n (Note that" + ' may be empty, from the "" case in .)\n ' + " ::= 0 | 1 | ... | 9 ::= |" + " ::= | . |" + ' . | . ::= "+" | "-" ' + " ::= | ::= |" + " | ::= Ki | Mi | Gi |" + " Ti | Pi | Ei\n (International System of units; See:" + " http://physics.nist.gov/cuu/Units/binary.html)\n ::=" + ' m | "" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 =' + ' 1k; I didn\'t choose the capitalization.)\n ::= "e"' + ' | "E" \n\nNo matter which of the three' + " exponent forms is used, no quantity may represent a number greater" + " than 2^63-1 in magnitude, nor may it have more than 3 decimal places." + " Numbers larger or more precise will be capped or rounded up. (E.g.:" + " 0.1m will rounded up to 1m.) This may be extended in the future if we" + " require larger or smaller quantities.\n\nWhen a Quantity is parsed" + " from a string, it will remember the type of suffix it had, and will" + " use the same type again when it is serialized.\n\nBefore serializing," + ' Quantity will be put in "canonical form". This means that' + " Exponent/suffix will be adjusted up or down (with a corresponding" + " increase or decrease in Mantissa) such that:\n a. No precision is" + " lost\n b. No fractional digits will be emitted\n c. The exponent" + " (or suffix) is as large as possible.\nThe sign will be omitted unless" + " the number is negative.\n\nExamples:\n 1.5 will be serialized as" + ' "1500m"\n 1.5Gi will be serialized as "1536Mi"\n\nNote that the' + " quantity will NEVER be internally represented by a floating point" + " number. That is the whole point of this exercise.\n\nNon-canonical" + " values will still parse as long as they are well formed, but will be" + " re-emitted in their canonical form. (So always use canonical form, or" + " don't diff.)\n\nThis format is intended to make it difficult to use" + " these numbers without writing some sort of special handling code in" + " the hopes that that will cause implementors to also use a fixed point" + " implementation." + ) ), - ) + ] diff --git a/src/hera/events/models/io/k8s/apimachinery/pkg/apis/meta/v1.py b/src/hera/events/models/io/k8s/apimachinery/pkg/apis/meta/v1.py index c42be1cd0..5b4e3bc35 100644 --- a/src/hera/events/models/io/k8s/apimachinery/pkg/apis/meta/v1.py +++ b/src/hera/events/models/io/k8s/apimachinery/pkg/apis/meta/v1.py @@ -6,58 +6,86 @@ from datetime import datetime from typing import Dict, List, Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field -class CreateOptions(BaseModel): - dry_run: Optional[List[str]] = Field( - default=None, - alias="dryRun", - title=( - "When present, indicates that modifications should not be\npersisted. An" - " invalid or unrecognized dryRun directive will\nresult in an error" - " response and no further processing of the\nrequest. Valid values are:\n-" - " All: all dry run stages will be processed\n+optional" - ), - ) - field_manager: Optional[str] = Field( - default=None, - alias="fieldManager", - title=( - "fieldManager is a name associated with the actor or entity\nthat is making" - " these changes. The value must be less than or\n128 characters long, and" - " only contain printable characters,\nas defined by" - " https://golang.org/pkg/unicode/#IsPrint.\n+optional" - ), - ) - field_validation: Optional[str] = Field( - default=None, - alias="fieldValidation", - title=( - "fieldValidation instructs the server on how to handle\nobjects in the" - " request (POST/PUT/PATCH) containing unknown\nor duplicate fields," - " provided that the `ServerSideFieldValidation`\nfeature gate is also" - " enabled. Valid values are:\n- Ignore: This will ignore any unknown fields" - " that are silently\ndropped from the object, and will ignore all but the" - " last duplicate\nfield that the decoder encounters. This is the default" - " behavior\nprior to v1.23 and is the default behavior when" - " the\n`ServerSideFieldValidation` feature gate is disabled.\n- Warn: This" - " will send a warning via the standard warning response\nheader for each" - " unknown field that is dropped from the object, and\nfor each duplicate" - " field that is encountered. The request will\nstill succeed if there are" - " no other errors, and will only persist\nthe last of any duplicate fields." - " This is the default when the\n`ServerSideFieldValidation` feature gate is" - " enabled.\n- Strict: This will fail the request with a BadRequest error" - " if\nany unknown fields would be dropped from the object, or if" - " any\nduplicate fields are present. The error returned from the" - " server\nwill contain all unknown and duplicate fields" - " encountered.\n+optional" - ), - ) +class Time(BaseModel): + __root__: Annotated[ + datetime, + Field( + description=( + "Time is a wrapper around time.Time which supports correct marshaling" + " to YAML and JSON. Wrappers are provided for many of the factory" + " methods that the time package offers." + ) + ), + ] -class FieldsV1(BaseModel): - pass +class ListMeta(BaseModel): + continue_: Annotated[ + Optional[str], + Field( + alias="continue", + description=( + "continue may be set if the user set a limit on the number of items" + " returned, and indicates that the server has more data available. The" + " value is opaque and may be used to issue another request to the" + " endpoint that served this list to retrieve the next set of available" + " objects. Continuing a consistent list may not be possible if the" + " server configuration has changed or more than a few minutes have" + " passed. The resourceVersion field returned when using this continue" + " value will be identical to the value in the first response, unless" + " you have received this token from an error message." + ), + ), + ] = None + remaining_item_count: Annotated[ + Optional[int], + Field( + alias="remainingItemCount", + description=( + "remainingItemCount is the number of subsequent items in the list which" + " are not included in this list response. If the list request contained" + " label or field selectors, then the number of remaining items is" + " unknown and the field will be left unset and omitted during" + " serialization. If the list is complete (either because it is not" + " chunking or because this is the last chunk), then there are no more" + " remaining items and this field will be left unset and omitted during" + " serialization. Servers older than v1.15 do not set this field. The" + " intended use of the remainingItemCount is *estimating* the size of a" + " collection. Clients should not rely on the remainingItemCount to be" + " set or to be exact." + ), + ), + ] = None + resource_version: Annotated[ + Optional[str], + Field( + alias="resourceVersion", + description=( + "String that identifies the server's internal version of this object" + " that can be used by clients to determine when objects have changed." + " Value must be treated as opaque by clients and passed unmodified back" + " to the server. Populated by the system. Read-only. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" + ), + ), + ] = None + self_link: Annotated[ + Optional[str], + Field( + alias="selfLink", + description=( + "selfLink is a URL representing this object. Populated by the system." + " Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field" + " in 1.20 release and the field is planned to be removed in 1.21" + " release." + ), + ), + ] = None class GroupVersionResource(BaseModel): @@ -66,430 +94,496 @@ class GroupVersionResource(BaseModel): version: Optional[str] = None -class LabelSelectorRequirement(BaseModel): - key: str = Field(..., description="key is the label key that the selector applies to.") - operator: str = Field( - ..., - description=( - "operator represents a key's relationship to a set of values. Valid" - " operators are In, NotIn, Exists and DoesNotExist." - ), - ) - values: Optional[List[str]] = Field( - default=None, - description=( - "values is an array of string values. If the operator is In or NotIn, the" - " values array must be non-empty. If the operator is Exists or" - " DoesNotExist, the values array must be empty. This array is replaced" - " during a strategic merge patch." - ), - ) +class CreateOptions(BaseModel): + dry_run: Annotated[ + Optional[List[str]], + Field( + alias="dryRun", + title=( + "When present, indicates that modifications should not be\npersisted." + " An invalid or unrecognized dryRun directive will\nresult in an error" + " response and no further processing of the\nrequest. Valid values" + " are:\n- All: all dry run stages will be processed\n+optional" + ), + ), + ] = None + field_manager: Annotated[ + Optional[str], + Field( + alias="fieldManager", + title=( + "fieldManager is a name associated with the actor or entity\nthat is" + " making these changes. The value must be less than or\n128 characters" + " long, and only contain printable characters,\nas defined by" + " https://golang.org/pkg/unicode/#IsPrint.\n+optional" + ), + ), + ] = None + field_validation: Annotated[ + Optional[str], + Field( + alias="fieldValidation", + title=( + "fieldValidation instructs the server on how to handle\nobjects in the" + " request (POST/PUT/PATCH) containing unknown\nor duplicate fields," + " provided that the `ServerSideFieldValidation`\nfeature gate is also" + " enabled. Valid values are:\n- Ignore: This will ignore any unknown" + " fields that are silently\ndropped from the object, and will ignore" + " all but the last duplicate\nfield that the decoder encounters. This" + " is the default behavior\nprior to v1.23 and is the default behavior" + " when the\n`ServerSideFieldValidation` feature gate is disabled.\n-" + " Warn: This will send a warning via the standard warning" + " response\nheader for each unknown field that is dropped from the" + " object, and\nfor each duplicate field that is encountered. The" + " request will\nstill succeed if there are no other errors, and will" + " only persist\nthe last of any duplicate fields. This is the default" + " when the\n`ServerSideFieldValidation` feature gate is enabled.\n-" + " Strict: This will fail the request with a BadRequest error if\nany" + " unknown fields would be dropped from the object, or if any\nduplicate" + " fields are present. The error returned from the server\nwill contain" + " all unknown and duplicate fields encountered.\n+optional" + ), + ), + ] = None -class ListMeta(BaseModel): - continue_: Optional[str] = Field( - default=None, - alias="continue", - description=( - "continue may be set if the user set a limit on the number of items" - " returned, and indicates that the server has more data available. The" - " value is opaque and may be used to issue another request to the endpoint" - " that served this list to retrieve the next set of available objects." - " Continuing a consistent list may not be possible if the server" - " configuration has changed or more than a few minutes have passed. The" - " resourceVersion field returned when using this continue value will be" - " identical to the value in the first response, unless you have received" - " this token from an error message." - ), - ) - remaining_item_count: Optional[int] = Field( - default=None, - alias="remainingItemCount", - description=( - "remainingItemCount is the number of subsequent items in the list which are" - " not included in this list response. If the list request contained label" - " or field selectors, then the number of remaining items is unknown and the" - " field will be left unset and omitted during serialization. If the list is" - " complete (either because it is not chunking or because this is the last" - " chunk), then there are no more remaining items and this field will be" - " left unset and omitted during serialization. Servers older than v1.15 do" - " not set this field. The intended use of the remainingItemCount is" - " *estimating* the size of a collection. Clients should not rely on the" - " remainingItemCount to be set or to be exact." - ), - ) - resource_version: Optional[str] = Field( - default=None, - alias="resourceVersion", - description=( - "String that identifies the server's internal version of this object that" - " can be used by clients to determine when objects have changed. Value must" - " be treated as opaque by clients and passed unmodified back to the server." - " Populated by the system. Read-only. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" - ), - ) - self_link: Optional[str] = Field( - default=None, - alias="selfLink", - description=( - "selfLink is a URL representing this object. Populated by the system." - " Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in" - " 1.20 release and the field is planned to be removed in 1.21 release." - ), - ) +class OwnerReference(BaseModel): + api_version: Annotated[str, Field(alias="apiVersion", description="API version of the referent.")] + block_owner_deletion: Annotated[ + Optional[bool], + Field( + alias="blockOwnerDeletion", + description=( + 'If true, AND if the owner has the "foregroundDeletion" finalizer, then' + " the owner cannot be deleted from the key-value store until this" + " reference is removed. Defaults to false. To set this field, a user" + ' needs "delete" permission of the owner, otherwise 422 (Unprocessable' + " Entity) will be returned." + ), + ), + ] = None + controller: Annotated[ + Optional[bool], + Field(description="If true, this reference points to the managing controller."), + ] = None + kind: Annotated[ + str, + Field( + description=( + "Kind of the referent. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] + name: Annotated[ + str, + Field( + description=("Name of the referent. More info:" " http://kubernetes.io/docs/user-guide/identifiers#names") + ), + ] + uid: Annotated[ + str, + Field( + description=("UID of the referent. More info:" " http://kubernetes.io/docs/user-guide/identifiers#uids") + ), + ] class MicroTime(BaseModel): - __root__: datetime = Field( - ..., - description="MicroTime is version of Time with microsecond level precision.", - ) + __root__: Annotated[ + datetime, + Field(description="MicroTime is version of Time with microsecond level precision."), + ] -class OwnerReference(BaseModel): - api_version: str = Field(..., alias="apiVersion", description="API version of the referent.") - block_owner_deletion: Optional[bool] = Field( - default=None, - alias="blockOwnerDeletion", - description=( - 'If true, AND if the owner has the "foregroundDeletion" finalizer, then the' - " owner cannot be deleted from the key-value store until this reference is" - ' removed. Defaults to false. To set this field, a user needs "delete"' - " permission of the owner, otherwise 422 (Unprocessable Entity) will be" - " returned." - ), - ) - controller: Optional[bool] = Field( - default=None, - description="If true, this reference points to the managing controller.", - ) - kind: str = Field( - ..., - description=( - "Kind of the referent. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - name: str = Field( - ..., - description=("Name of the referent. More info:" " http://kubernetes.io/docs/user-guide/identifiers#names"), - ) - uid: str = Field( - ..., - description=("UID of the referent. More info:" " http://kubernetes.io/docs/user-guide/identifiers#uids"), - ) +class FieldsV1(BaseModel): + pass -class StatusCause(BaseModel): - field: Optional[str] = Field( - default=None, - description=( - "The field of the resource that has caused this error, as named by its JSON" - " serialization. May include dot and postfix notation for nested" - " attributes. Arrays are zero-indexed. Fields may appear more than once in" - " an array of causes due to fields having multiple errors." - ' Optional.\n\nExamples:\n "name" - the field "name" on the current' - ' resource\n "items[0].name" - the field "name" on the first array entry' - ' in "items"' - ), - ) - message: Optional[str] = Field( - default=None, - description=( - "A human-readable description of the cause of the error. This field may be" - " presented as-is to a reader." - ), - ) - reason: Optional[str] = Field( - default=None, - description=( - "A machine-readable description of the cause of the error. If this value is" - " empty there is no information available." - ), - ) +class LabelSelectorRequirement(BaseModel): + key: Annotated[str, Field(description="key is the label key that the selector applies to.")] + operator: Annotated[ + str, + Field( + description=( + "operator represents a key's relationship to a set of values. Valid" + " operators are In, NotIn, Exists and DoesNotExist." + ) + ), + ] + values: Annotated[ + Optional[List[str]], + Field( + description=( + "values is an array of string values. If the operator is In or NotIn," + " the values array must be non-empty. If the operator is Exists or" + " DoesNotExist, the values array must be empty. This array is replaced" + " during a strategic merge patch." + ) + ), + ] = None -class Time(BaseModel): - __root__: datetime = Field( - ..., - description=( - "Time is a wrapper around time.Time which supports correct marshaling to" - " YAML and JSON. Wrappers are provided for many of the factory methods" - " that the time package offers." - ), - ) +class StatusCause(BaseModel): + field: Annotated[ + Optional[str], + Field( + description=( + "The field of the resource that has caused this error, as named by its" + " JSON serialization. May include dot and postfix notation for nested" + " attributes. Arrays are zero-indexed. Fields may appear more than" + " once in an array of causes due to fields having multiple errors." + ' Optional.\n\nExamples:\n "name" - the field "name" on the current' + ' resource\n "items[0].name" - the field "name" on the first array' + ' entry in "items"' + ) + ), + ] = None + message: Annotated[ + Optional[str], + Field( + description=( + "A human-readable description of the cause of the error. This field" + " may be presented as-is to a reader." + ) + ), + ] = None + reason: Annotated[ + Optional[str], + Field( + description=( + "A machine-readable description of the cause of the error. If this" + " value is empty there is no information available." + ) + ), + ] = None -class LabelSelector(BaseModel): - match_expressions: Optional[List[LabelSelectorRequirement]] = Field( - default=None, - alias="matchExpressions", - description=("matchExpressions is a list of label selector requirements. The" " requirements are ANDed."), - ) - match_labels: Optional[Dict[str, str]] = Field( - default=None, - alias="matchLabels", - description=( - "matchLabels is a map of {key,value} pairs. A single {key,value} in the" - " matchLabels map is equivalent to an element of matchExpressions, whose" - ' key field is "key", the operator is "In", and the values array contains' - ' only "value". The requirements are ANDed.' - ), - ) +class ManagedFieldsEntry(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the version of this resource that this field set" + ' applies to. The format is "group/version" just like the top-level' + " APIVersion field. It is necessary to track the version of a field set" + " because it cannot be automatically converted." + ), + ), + ] = None + fields_type: Annotated[ + Optional[str], + Field( + alias="fieldsType", + description=( + "FieldsType is the discriminator for the different fields format and" + ' version. There is currently only one possible value: "FieldsV1"' + ), + ), + ] = None + fields_v1: Annotated[ + Optional[FieldsV1], + Field( + alias="fieldsV1", + description=("FieldsV1 holds the first JSON version format as described in the" ' "FieldsV1" type.'), + ), + ] = None + manager: Annotated[ + Optional[str], + Field(description=("Manager is an identifier of the workflow managing these fields.")), + ] = None + operation: Annotated[ + Optional[str], + Field( + description=( + "Operation is the type of operation which lead to this" + " ManagedFieldsEntry being created. The only valid values for this" + " field are 'Apply' and 'Update'." + ) + ), + ] = None + subresource: Annotated[ + Optional[str], + Field( + description=( + "Subresource is the name of the subresource used to update that object," + " or empty string if the object was updated through the main resource." + " The value of this field is used to distinguish between managers, even" + " if they share the same name. For example, a status update will be" + " distinct from a regular update using the same manager name. Note that" + " the APIVersion field is not related to the Subresource field and it" + " always corresponds to the version of the main resource." + ) + ), + ] = None + time: Annotated[ + Optional[Time], + Field( + description=( + "Time is timestamp of when these fields were set. It should always be" " empty if Operation is 'Apply'" + ) + ), + ] = None -class ManagedFieldsEntry(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the version of this resource that this field set" - ' applies to. The format is "group/version" just like the top-level' - " APIVersion field. It is necessary to track the version of a field set" - " because it cannot be automatically converted." - ), - ) - fields_type: Optional[str] = Field( - default=None, - alias="fieldsType", - description=( - "FieldsType is the discriminator for the different fields format and" - ' version. There is currently only one possible value: "FieldsV1"' - ), - ) - fields_v1: Optional[FieldsV1] = Field( - default=None, - alias="fieldsV1", - description=("FieldsV1 holds the first JSON version format as described in the" ' "FieldsV1" type.'), - ) - manager: Optional[str] = Field( - default=None, - description="Manager is an identifier of the workflow managing these fields.", - ) - operation: Optional[str] = Field( - default=None, - description=( - "Operation is the type of operation which lead to this ManagedFieldsEntry" - " being created. The only valid values for this field are 'Apply' and" - " 'Update'." - ), - ) - subresource: Optional[str] = Field( - default=None, - description=( - "Subresource is the name of the subresource used to update that object, or" - " empty string if the object was updated through the main resource. The" - " value of this field is used to distinguish between managers, even if they" - " share the same name. For example, a status update will be distinct from a" - " regular update using the same manager name. Note that the APIVersion" - " field is not related to the Subresource field and it always corresponds" - " to the version of the main resource." - ), - ) - time: Optional[Time] = Field( - default=None, - description=( - "Time is timestamp of when these fields were set. It should always be empty" " if Operation is 'Apply'" - ), - ) +class LabelSelector(BaseModel): + match_expressions: Annotated[ + Optional[List[LabelSelectorRequirement]], + Field( + alias="matchExpressions", + description=("matchExpressions is a list of label selector requirements. The" " requirements are ANDed."), + ), + ] = None + match_labels: Annotated[ + Optional[Dict[str, str]], + Field( + alias="matchLabels", + description=( + "matchLabels is a map of {key,value} pairs. A single {key,value} in the" + " matchLabels map is equivalent to an element of matchExpressions," + ' whose key field is "key", the operator is "In", and the values array' + ' contains only "value". The requirements are ANDed.' + ), + ), + ] = None class ObjectMeta(BaseModel): - annotations: Optional[Dict[str, str]] = Field( - default=None, - description=( - "Annotations is an unstructured key value map stored with a resource that" - " may be set by external tools to store and retrieve arbitrary metadata." - " They are not queryable and should be preserved when modifying objects." - " More info: http://kubernetes.io/docs/user-guide/annotations" - ), - ) - cluster_name: Optional[str] = Field( - default=None, - alias="clusterName", - description=( - "The name of the cluster which the object belongs to. This is used to" - " distinguish resources with same name and namespace in different clusters." - " This field is not set anywhere right now and apiserver is going to ignore" - " it if set in create or update request." - ), - ) - creation_timestamp: Optional[Time] = Field( - default=None, - alias="creationTimestamp", - description=( - "CreationTimestamp is a timestamp representing the server time when this" - " object was created. It is not guaranteed to be set in happens-before" - " order across separate operations. Clients may not set this value. It is" - " represented in RFC3339 form and is in UTC.\n\nPopulated by the system." - " Read-only. Null for lists. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - ), - ) - deletion_grace_period_seconds: Optional[int] = Field( - default=None, - alias="deletionGracePeriodSeconds", - description=( - "Number of seconds allowed for this object to gracefully terminate before" - " it will be removed from the system. Only set when deletionTimestamp is" - " also set. May only be shortened. Read-only." - ), - ) - deletion_timestamp: Optional[Time] = Field( - default=None, - alias="deletionTimestamp", - description=( - "DeletionTimestamp is RFC 3339 date and time at which this resource will be" - " deleted. This field is set by the server when a graceful deletion is" - " requested by the user, and is not directly settable by a client. The" - " resource is expected to be deleted (no longer visible from resource" - " lists, and not reachable by name) after the time in this field, once the" - " finalizers list is empty. As long as the finalizers list contains items," - " deletion is blocked. Once the deletionTimestamp is set, this value may" - " not be unset or be set further into the future, although it may be" - " shortened or the resource may be deleted prior to this time. For example," - " a user may request that a pod is deleted in 30 seconds. The Kubelet will" - " react by sending a graceful termination signal to the containers in the" - " pod. After that 30 seconds, the Kubelet will send a hard termination" - " signal (SIGKILL) to the container and after cleanup, remove the pod from" - " the API. In the presence of network partitions, this object may still" - " exist after this timestamp, until an administrator or automated process" - " can determine the resource is fully terminated. If not set, graceful" - " deletion of the object has not been requested.\n\nPopulated by the system" - " when a graceful deletion is requested. Read-only. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - ), - ) - finalizers: Optional[List[str]] = Field( - default=None, - description=( - "Must be empty before the object is deleted from the registry. Each entry" - " is an identifier for the responsible component that will remove the entry" - " from the list. If the deletionTimestamp of the object is non-nil, entries" - " in this list can only be removed. Finalizers may be processed and removed" - " in any order. Order is NOT enforced because it introduces significant" - " risk of stuck finalizers. finalizers is a shared field, any actor with" - " permission can reorder it. If the finalizer list is processed in order," - " then this can lead to a situation in which the component responsible for" - " the first finalizer in the list is waiting for a signal (field value," - " external system, or other) produced by a component responsible for a" - " finalizer later in the list, resulting in a deadlock. Without enforced" - " ordering finalizers are free to order amongst themselves and are not" - " vulnerable to ordering changes in the list." - ), - ) - generate_name: Optional[str] = Field( - default=None, - alias="generateName", - description=( - "GenerateName is an optional prefix, used by the server, to generate a" - " unique name ONLY IF the Name field has not been provided. If this field" - " is used, the name returned to the client will be different than the name" - " passed. This value will also be combined with a unique suffix. The" - " provided value has the same validation rules as the Name field, and may" - " be truncated by the length of the suffix required to make the value" - " unique on the server.\n\nIf this field is specified and the generated" - " name exists, the server will NOT return a 409 - instead, it will either" - " return 201 Created or 500 with Reason ServerTimeout indicating a unique" - " name could not be found in the time allotted, and the client should retry" - " (optionally after the time indicated in the Retry-After" - " header).\n\nApplied only if Name is not specified. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency" - ), - ) - generation: Optional[int] = Field( - default=None, - description=( - "A sequence number representing a specific generation of the desired state." - " Populated by the system. Read-only." - ), - ) - labels: Optional[Dict[str, str]] = Field( - default=None, - description=( - "Map of string keys and values that can be used to organize and categorize" - " (scope and select) objects. May match selectors of replication" - " controllers and services. More info:" - " http://kubernetes.io/docs/user-guide/labels" - ), - ) - managed_fields: Optional[List[ManagedFieldsEntry]] = Field( - default=None, - alias="managedFields", - description=( - "ManagedFields maps workflow-id and version to the set of fields that are" - " managed by that workflow. This is mostly for internal housekeeping, and" - " users typically shouldn't need to set or understand this field. A" - " workflow can be the user's name, a controller's name, or the name of a" - ' specific apply path like "ci-cd". The set of fields is always in the' - " version that the workflow used when modifying the object." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name must be unique within a namespace. Is required when creating" - " resources, although some resources may allow a client to request the" - " generation of an appropriate name automatically. Name is primarily" - " intended for creation idempotence and configuration definition. Cannot be" - " updated. More info:" - " http://kubernetes.io/docs/user-guide/identifiers#names" - ), - ) - namespace: Optional[str] = Field( - default=None, - description=( - "Namespace defines the space within which each name must be unique. An" - ' empty namespace is equivalent to the "default" namespace, but "default"' - " is the canonical representation. Not all objects are required to be" - " scoped to a namespace - the value of this field for those objects will be" - " empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info:" - " http://kubernetes.io/docs/user-guide/namespaces" - ), - ) - owner_references: Optional[List[OwnerReference]] = Field( - default=None, - alias="ownerReferences", - description=( - "List of objects depended by this object. If ALL objects in the list have" - " been deleted, this object will be garbage collected. If this object is" - " managed by a controller, then an entry in this list will point to this" - " controller, with the controller field set to true. There cannot be more" - " than one managing controller." - ), - ) - resource_version: Optional[str] = Field( - default=None, - alias="resourceVersion", - description=( - "An opaque value that represents the internal version of this object that" - " can be used by clients to determine when objects have changed. May be" - " used for optimistic concurrency, change detection, and the watch" - " operation on a resource or set of resources. Clients must treat these" - " values as opaque and passed unmodified back to the server. They may only" - " be valid for a particular resource or set of resources.\n\nPopulated by" - " the system. Read-only. Value must be treated as opaque by clients and ." - " More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" - ), - ) - self_link: Optional[str] = Field( - default=None, - alias="selfLink", - description=( - "SelfLink is a URL representing this object. Populated by the system." - " Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in" - " 1.20 release and the field is planned to be removed in 1.21 release." - ), - ) - uid: Optional[str] = Field( - default=None, - description=( - "UID is the unique in time and space value for this object. It is typically" - " generated by the server on successful creation of a resource and is not" - " allowed to change on PUT operations.\n\nPopulated by the system." - " Read-only. More info:" - " http://kubernetes.io/docs/user-guide/identifiers#uids" - ), - ) + annotations: Annotated[ + Optional[Dict[str, str]], + Field( + description=( + "Annotations is an unstructured key value map stored with a resource" + " that may be set by external tools to store and retrieve arbitrary" + " metadata. They are not queryable and should be preserved when" + " modifying objects. More info:" + " http://kubernetes.io/docs/user-guide/annotations" + ) + ), + ] = None + cluster_name: Annotated[ + Optional[str], + Field( + alias="clusterName", + description=( + "The name of the cluster which the object belongs to. This is used to" + " distinguish resources with same name and namespace in different" + " clusters. This field is not set anywhere right now and apiserver is" + " going to ignore it if set in create or update request." + ), + ), + ] = None + creation_timestamp: Annotated[ + Optional[Time], + Field( + alias="creationTimestamp", + description=( + "CreationTimestamp is a timestamp representing the server time when" + " this object was created. It is not guaranteed to be set in" + " happens-before order across separate operations. Clients may not set" + " this value. It is represented in RFC3339 form and is in" + " UTC.\n\nPopulated by the system. Read-only. Null for lists. More" + " info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + ), + ), + ] = None + deletion_grace_period_seconds: Annotated[ + Optional[int], + Field( + alias="deletionGracePeriodSeconds", + description=( + "Number of seconds allowed for this object to gracefully terminate" + " before it will be removed from the system. Only set when" + " deletionTimestamp is also set. May only be shortened. Read-only." + ), + ), + ] = None + deletion_timestamp: Annotated[ + Optional[Time], + Field( + alias="deletionTimestamp", + description=( + "DeletionTimestamp is RFC 3339 date and time at which this resource" + " will be deleted. This field is set by the server when a graceful" + " deletion is requested by the user, and is not directly settable by a" + " client. The resource is expected to be deleted (no longer visible" + " from resource lists, and not reachable by name) after the time in" + " this field, once the finalizers list is empty. As long as the" + " finalizers list contains items, deletion is blocked. Once the" + " deletionTimestamp is set, this value may not be unset or be set" + " further into the future, although it may be shortened or the resource" + " may be deleted prior to this time. For example, a user may request" + " that a pod is deleted in 30 seconds. The Kubelet will react by" + " sending a graceful termination signal to the containers in the pod." + " After that 30 seconds, the Kubelet will send a hard termination" + " signal (SIGKILL) to the container and after cleanup, remove the pod" + " from the API. In the presence of network partitions, this object may" + " still exist after this timestamp, until an administrator or automated" + " process can determine the resource is fully terminated. If not set," + " graceful deletion of the object has not been requested.\n\nPopulated" + " by the system when a graceful deletion is requested. Read-only. More" + " info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + ), + ), + ] = None + finalizers: Annotated[ + Optional[List[str]], + Field( + description=( + "Must be empty before the object is deleted from the registry. Each" + " entry is an identifier for the responsible component that will remove" + " the entry from the list. If the deletionTimestamp of the object is" + " non-nil, entries in this list can only be removed. Finalizers may be" + " processed and removed in any order. Order is NOT enforced because it" + " introduces significant risk of stuck finalizers. finalizers is a" + " shared field, any actor with permission can reorder it. If the" + " finalizer list is processed in order, then this can lead to a" + " situation in which the component responsible for the first finalizer" + " in the list is waiting for a signal (field value, external system, or" + " other) produced by a component responsible for a finalizer later in" + " the list, resulting in a deadlock. Without enforced ordering" + " finalizers are free to order amongst themselves and are not" + " vulnerable to ordering changes in the list." + ) + ), + ] = None + generate_name: Annotated[ + Optional[str], + Field( + alias="generateName", + description=( + "GenerateName is an optional prefix, used by the server, to generate a" + " unique name ONLY IF the Name field has not been provided. If this" + " field is used, the name returned to the client will be different than" + " the name passed. This value will also be combined with a unique" + " suffix. The provided value has the same validation rules as the Name" + " field, and may be truncated by the length of the suffix required to" + " make the value unique on the server.\n\nIf this field is specified" + " and the generated name exists, the server will NOT return a 409 -" + " instead, it will either return 201 Created or 500 with Reason" + " ServerTimeout indicating a unique name could not be found in the time" + " allotted, and the client should retry (optionally after the time" + " indicated in the Retry-After header).\n\nApplied only if Name is not" + " specified. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency" + ), + ), + ] = None + generation: Annotated[ + Optional[int], + Field( + description=( + "A sequence number representing a specific generation of the desired" + " state. Populated by the system. Read-only." + ) + ), + ] = None + labels: Annotated[ + Optional[Dict[str, str]], + Field( + description=( + "Map of string keys and values that can be used to organize and" + " categorize (scope and select) objects. May match selectors of" + " replication controllers and services. More info:" + " http://kubernetes.io/docs/user-guide/labels" + ) + ), + ] = None + managed_fields: Annotated[ + Optional[List[ManagedFieldsEntry]], + Field( + alias="managedFields", + description=( + "ManagedFields maps workflow-id and version to the set of fields that" + " are managed by that workflow. This is mostly for internal" + " housekeeping, and users typically shouldn't need to set or" + " understand this field. A workflow can be the user's name, a" + " controller's name, or the name of a specific apply path like" + ' "ci-cd". The set of fields is always in the version that the workflow' + " used when modifying the object." + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name must be unique within a namespace. Is required when creating" + " resources, although some resources may allow a client to request the" + " generation of an appropriate name automatically. Name is primarily" + " intended for creation idempotence and configuration definition." + " Cannot be updated. More info:" + " http://kubernetes.io/docs/user-guide/identifiers#names" + ) + ), + ] = None + namespace: Annotated[ + Optional[str], + Field( + description=( + "Namespace defines the space within which each name must be unique. An" + ' empty namespace is equivalent to the "default" namespace, but' + ' "default" is the canonical representation. Not all objects are' + " required to be scoped to a namespace - the value of this field for" + " those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be" + " updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + ) + ), + ] = None + owner_references: Annotated[ + Optional[List[OwnerReference]], + Field( + alias="ownerReferences", + description=( + "List of objects depended by this object. If ALL objects in the list" + " have been deleted, this object will be garbage collected. If this" + " object is managed by a controller, then an entry in this list will" + " point to this controller, with the controller field set to true." + " There cannot be more than one managing controller." + ), + ), + ] = None + resource_version: Annotated[ + Optional[str], + Field( + alias="resourceVersion", + description=( + "An opaque value that represents the internal version of this object" + " that can be used by clients to determine when objects have changed." + " May be used for optimistic concurrency, change detection, and the" + " watch operation on a resource or set of resources. Clients must treat" + " these values as opaque and passed unmodified back to the server. They" + " may only be valid for a particular resource or set of" + " resources.\n\nPopulated by the system. Read-only. Value must be" + " treated as opaque by clients and . More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" + ), + ), + ] = None + self_link: Annotated[ + Optional[str], + Field( + alias="selfLink", + description=( + "SelfLink is a URL representing this object. Populated by the system." + " Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field" + " in 1.20 release and the field is planned to be removed in 1.21" + " release." + ), + ), + ] = None + uid: Annotated[ + Optional[str], + Field( + description=( + "UID is the unique in time and space value for this object. It is" + " typically generated by the server on successful creation of a" + " resource and is not allowed to change on PUT operations.\n\nPopulated" + " by the system. Read-only. More info:" + " http://kubernetes.io/docs/user-guide/identifiers#uids" + ) + ), + ] = None diff --git a/src/hera/events/models/io/k8s/apimachinery/pkg/util/intstr.py b/src/hera/events/models/io/k8s/apimachinery/pkg/util/intstr.py index 592fcbd0c..156f2ff6c 100644 --- a/src/hera/events/models/io/k8s/apimachinery/pkg/util/intstr.py +++ b/src/hera/events/models/io/k8s/apimachinery/pkg/util/intstr.py @@ -3,8 +3,10 @@ from __future__ import annotations +from typing import Union + from hera.shared._pydantic import BaseModel class IntOrString(BaseModel): - __root__: str + __root__: Union[str, int] diff --git a/src/hera/events/models/io/k8s/apimachinery/pkg/util/intstr.pyi b/src/hera/events/models/io/k8s/apimachinery/pkg/util/intstr.pyi index 6f9697c73..1db9eb8d6 100644 --- a/src/hera/events/models/io/k8s/apimachinery/pkg/util/intstr.pyi +++ b/src/hera/events/models/io/k8s/apimachinery/pkg/util/intstr.pyi @@ -1,4 +1,6 @@ +from typing import Union + from hera.shared._pydantic import BaseModel as BaseModel class IntOrString(BaseModel): - __root__: str + __root__: Union[str, int] diff --git a/src/hera/events/models/sensor.py b/src/hera/events/models/sensor.py index 174300031..c1868fbd8 100644 --- a/src/hera/events/models/sensor.py +++ b/src/hera/events/models/sensor.py @@ -5,6 +5,8 @@ from typing import Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from .io.argoproj.events import v1alpha1 @@ -16,20 +18,24 @@ class DeleteSensorResponse(BaseModel): class LogEntry(BaseModel): - dependency_name: Optional[str] = Field( - default=None, alias="dependencyName", title="optional - trigger dependency name" - ) - event_context: Optional[str] = Field(default=None, alias="eventContext", title="optional - Cloud Event context") + dependency_name: Annotated[ + Optional[str], + Field(alias="dependencyName", title="optional - trigger dependency name"), + ] = None + event_context: Annotated[ + Optional[str], + Field(alias="eventContext", title="optional - Cloud Event context"), + ] = None level: Optional[str] = None msg: Optional[str] = None namespace: Optional[str] = None - sensor_name: Optional[str] = Field(default=None, alias="sensorName") + sensor_name: Annotated[Optional[str], Field(alias="sensorName")] = None time: Optional[v1.Time] = None - trigger_name: Optional[str] = Field(default=None, alias="triggerName", title="optional - any trigger name") + trigger_name: Annotated[Optional[str], Field(alias="triggerName", title="optional - any trigger name")] = None class CreateSensorRequest(BaseModel): - create_options: Optional[v1.CreateOptions] = Field(default=None, alias="createOptions") + create_options: Annotated[Optional[v1.CreateOptions], Field(alias="createOptions")] = None namespace: Optional[str] = None sensor: Optional[v1alpha1.Sensor] = None diff --git a/src/hera/events/service.py b/src/hera/events/service.py index 9eba919ce..aa5d71020 100644 --- a/src/hera/events/service.py +++ b/src/hera/events/service.py @@ -219,7 +219,7 @@ def get_info(self) -> InfoResponse: ) if resp.ok: - return InfoResponse() + return InfoResponse(**resp.json()) raise exception_from_server_response(resp) @@ -586,7 +586,7 @@ def get_user_info(self) -> GetUserInfoResponse: ) if resp.ok: - return GetUserInfoResponse() + return GetUserInfoResponse(**resp.json()) raise exception_from_server_response(resp) diff --git a/src/hera/expr/_node.py b/src/hera/expr/_node.py index 02d811341..6deb7b1ea 100644 --- a/src/hera/expr/_node.py +++ b/src/hera/expr/_node.py @@ -334,10 +334,10 @@ def __init__(self, value: Node, attribute: Union[str, int]): stop = attribute.stop if attribute.stop is not None else "" self.attribute = f"{start}:{stop}" else: - self.attribute = repr(attribute) + self.attribute = repr(attribute) # type: ignore def __repr__(self) -> str: - return f"{self.value}[{self.attribute}]" + return f"{self.value}[{self.attribute}]" # type: ignore class Builtin(Node): diff --git a/src/hera/workflows/_mixins.py b/src/hera/workflows/_mixins.py index e8802419e..85215fae4 100644 --- a/src/hera/workflows/_mixins.py +++ b/src/hera/workflows/_mixins.py @@ -131,9 +131,9 @@ def normalize_to_list_if_not_valid_type(v: Optional[OneOrMany]) -> Optional[List ] """`InputsT` is the main type associated with inputs that can be specified in Hera workflows, dags, steps, etc. -This type enables uses of Hera auto-generated models such as (`hera.workflows.models.Inputs`, -`hera.workflows.models.Parameter`), Hera managed models such as (`hera.workflows.Parameter`, -`hera.workflows.Artifact`), dictionary mappings of parameter names to values (auto-converted by Hera to +This type enables uses of Hera auto-generated models such as (`hera.workflows.models.Inputs`, +`hera.workflows.models.Parameter`), Hera managed models such as (`hera.workflows.Parameter`, +`hera.workflows.Artifact`), dictionary mappings of parameter names to values (auto-converted by Hera to `hera.workflows.Parameter`), or lists of any of the aforementioned objects. """ @@ -145,8 +145,8 @@ def normalize_to_list_if_not_valid_type(v: Optional[OneOrMany]) -> Optional[List ] """`OutputsT` is the main type associated with outputs the can be specified in Hera workflows, dags, steps, etc. -This type enables uses of Hera auto-generated models such as (`hera.workflows.models.Outputs`, -`hera.workflows.models.Parameter`), Hera managed models such as (`hera.workflows.Parameter`, +This type enables uses of Hera auto-generated models such as (`hera.workflows.models.Outputs`, +`hera.workflows.models.Parameter`), Hera managed models such as (`hera.workflows.Parameter`, `hera.workflows.Artifact`), or lists of the aforementioned objects. """ @@ -158,7 +158,7 @@ def normalize_to_list_if_not_valid_type(v: Optional[OneOrMany]) -> Optional[List ] """`ArgumentsT` is the main type associated with arguments that can be used on DAG tasks, steps, etc. -This type enables uses of the Hera auto-generated `hera.workflows.models.Arguments` model, Hera managed models such as +This type enables uses of the Hera auto-generated `hera.workflows.models.Arguments` model, Hera managed models such as `hera.workflows.Parameter`, `hera.workflows.Artifact`, a dictionary mapping of parameter names to values, or a list of any of the aforementioned objects. """ @@ -171,28 +171,28 @@ def normalize_to_list_if_not_valid_type(v: Optional[OneOrMany]) -> Optional[List OneOrMany[ModelPrometheus], ] ] -"""`MetricsT` is the core Hera type for Prometheus metrics. +"""`MetricsT` is the core Hera type for Prometheus metrics. This metrics type enables users to use either auto-generated Hera metrics, lists of auto-generated single metrics, or -the variations of metrics provided by `hera.workflows.metrics.*` +the variations of metrics provided by `hera.workflows.metrics.*` """ EnvT = Optional[OneOrMany[Union[_BaseEnv, EnvVar, Dict[str, Any]]]] """`EnvT` is the core Hera type for environment variables. -The env type enables setting single valued environment variables, lists of environment variables, or dictionary +The env type enables setting single valued environment variables, lists of environment variables, or dictionary mappings of env variables names to values, which are automatically parsed by Hera. """ EnvFromT = Optional[OneOrMany[Union[_BaseEnvFrom, EnvFromSource]]] """`EnvFromT` is the core Hera type for environment variables derived from Argo/Kubernetes sources. -This env type enables specifying environment variables in base form, as `hera.workflows.env` form, or lists of the +This env type enables specifying environment variables in base form, as `hera.workflows.env` form, or lists of the aforementioned objects. """ VolumesT = Optional[OneOrMany[Union[ModelVolume, _BaseVolume]]] -"""`VolumesT` is the core Hera type for volumes. +"""`VolumesT` is the core Hera type for volumes. This volume type is used to specify the configuration of volumes to be automatically created by Argo/K8s and mounted by Hera at specific mount paths in containers. @@ -439,7 +439,7 @@ def _build_env_from(self) -> Optional[List[EnvFromSource]]: class MetricsMixin(BaseMixin): """`MetricsMixin` provides the ability to set metrics on a n object.""" - metrics: MetricsT = None + metrics: Optional[MetricsT] = None _normalize_metrics = validator("metrics", allow_reuse=True)(normalize_to_list_or(Metrics, ModelMetrics)) def _build_metrics(self) -> Optional[ModelMetrics]: @@ -464,9 +464,7 @@ class TemplateMixin(SubNodeMixin, HookMixin, MetricsMixin): The supported sub-template fields are `Script`, `Data`, `DAG`, `Resource`, `Container`, `ContainerSet`, etc. """ - active_deadline_seconds: Optional[ - Union[int, str, IntOrString] - ] = None # TODO: This type blocks YAML roundtrip. Consider using type: Optional[int] + active_deadline_seconds: Optional[IntOrString] = None affinity: Optional[Affinity] = None archive_location: Optional[ArtifactLocation] = None automount_service_account_token: Optional[bool] = None @@ -495,6 +493,12 @@ class TemplateMixin(SubNodeMixin, HookMixin, MetricsMixin): timeout: Optional[str] = None tolerations: Optional[List[Toleration]] = None + @validator("active_deadline_seconds") + def _convert_active_deadline_seconds(cls, v) -> Optional[IntOrString]: + if v is None or isinstance(v, IntOrString): + return v + return IntOrString(__root__=v) + def _build_sidecars(self) -> Optional[List[ModelUserContainer]]: """Builds the `sidecars` field and optionally returns a list of `UserContainer`.""" if self.sidecars is None: @@ -505,13 +509,6 @@ def _build_sidecars(self) -> Optional[List[ModelUserContainer]]: return [s.build() for s in self.sidecars] - def _build_active_deadline_seconds(self) -> Optional[IntOrString]: - """Builds the `active_deadline_seconds` field and optionally returns a generated `IntOrString`.""" - if self.active_deadline_seconds is None: - return None - - return IntOrString(__root__=str(self.active_deadline_seconds)) - def _build_metadata(self) -> Optional[Metadata]: """Builds the `metadata` field of the template since the `annotations` and `labels` fields are separated.""" if self.annotations is None and self.labels is None: @@ -543,7 +540,7 @@ class VolumeMixin(BaseMixin): mixin should be careful to *not* generate multiple PVCs for the same volume. """ - volumes: VolumesT = None + volumes: Optional[VolumesT] = None _normalize_fields = validator("volumes", allow_reuse=True)(normalize_to_list) def _build_volumes(self) -> Optional[List[ModelVolume]]: @@ -865,12 +862,12 @@ def _build_with_items(self) -> Optional[List[Item]]: class EnvIOMixin(EnvMixin, IOMixin): """`EnvIOMixin` provides the capacity to use environment variables.""" - def _build_params_from_env(self) -> Optional[List[Parameter]]: + def _build_params_from_env(self) -> Optional[List[ModelParameter]]: """Assemble a list of any environment variables that are set to obtain values from `Parameter`s.""" if self.env is None: return None - params: Optional[List[Parameter]] = None + params: Optional[List[ModelParameter]] = None for spec in self.env: if isinstance(spec, Env) and spec.value_from_input is not None: value = ( @@ -879,9 +876,9 @@ def _build_params_from_env(self) -> Optional[List[Parameter]]: else spec.value_from_input ) params = ( - [Parameter(name=spec.param_name, value=value)] + [ModelParameter(name=spec.param_name, value=value)] if params is None - else params + [Parameter(name=spec.param_name, value=value)] + else params + [ModelParameter(name=spec.param_name, value=value)] ) return params or None @@ -921,7 +918,7 @@ class TemplateInvocatorSubNodeMixin(BaseMixin): continue_on: Optional[ContinueOn] = None hooks: Optional[Dict[str, LifecycleHook]] = None on_exit: Optional[Union[str, Templatable]] = None - template: Optional[Union[str, Template, TemplateMixin]] = None + template: Optional[Union[str, Template, TemplateMixin, CallableTemplateMixin]] = None template_ref: Optional[TemplateRef] = None inline: Optional[Union[Template, TemplateMixin]] = None when: Optional[str] = None diff --git a/src/hera/workflows/artifact.py b/src/hera/workflows/artifact.py index 2cf38322f..365ce4dbc 100644 --- a/src/hera/workflows/artifact.py +++ b/src/hera/workflows/artifact.py @@ -17,6 +17,7 @@ ArtifactoryArtifact as _ModelArtifactoryArtifact, ArtifactPaths as _ModelArtifactPaths, AzureArtifact as _ModelAzureArtifact, + ConfigMapKeySelector, GCSArtifact as _ModelGCSArtifact, GitArtifact as _ModelGitArtifact, HDFSArtifact as _ModelHDFSArtifact, @@ -73,7 +74,7 @@ class Artifact(BaseModel): path: Optional[str] = None """path where the artifact should be placed/loaded from""" - recurse_mode: Optional[str] = None + recurse_mode: Optional[bool] = None """recursion mode when applying the permissions of the artifact if it is an artifact folder""" sub_path: Optional[str] = None @@ -109,6 +110,7 @@ def _build_archive(self) -> Optional[_ModelArchiveStrategy]: def _build_artifact(self) -> _ModelArtifact: self._check_name() + assert self.name return _ModelArtifact( name=self.name, archive=self._build_archive(), @@ -270,7 +272,7 @@ class HDFSArtifact(Artifact): force: Optional[bool] = None hdfs_user: Optional[str] krb_c_cache_secret: Optional[SecretKeySelector] = None - krb_config_config_map: Optional[SecretKeySelector] = None + krb_config_config_map: Optional[ConfigMapKeySelector] = None krb_keytab_secret: Optional[SecretKeySelector] = None krb_realm: Optional[str] = None krb_service_principal_name: Optional[str] = None diff --git a/src/hera/workflows/cluster_workflow_template.py b/src/hera/workflows/cluster_workflow_template.py index 3f92651da..8cc4805be 100644 --- a/src/hera/workflows/cluster_workflow_template.py +++ b/src/hera/workflows/cluster_workflow_template.py @@ -26,7 +26,7 @@ def create(self) -> TWorkflow: # type: ignore """Creates the ClusterWorkflowTemplate on the Argo cluster.""" assert self.workflows_service, "workflow service not initialized" return self.workflows_service.create_cluster_workflow_template( - ClusterWorkflowTemplateCreateRequest(template=self.build()) + ClusterWorkflowTemplateCreateRequest(template=self.build()) # type: ignore ) def get(self) -> TWorkflow: @@ -55,14 +55,14 @@ def update(self) -> TWorkflow: return self.create() return self.workflows_service.update_cluster_workflow_template( self.name, - ClusterWorkflowTemplateUpdateRequest(template=template), + ClusterWorkflowTemplateUpdateRequest(template=template), # type: ignore ) def lint(self) -> TWorkflow: """Lints the ClusterWorkflowTemplate using the Argo cluster.""" assert self.workflows_service, "workflow service not initialized" return self.workflows_service.lint_cluster_workflow_template( - ClusterWorkflowTemplateLintRequest(template=self.build()) + ClusterWorkflowTemplateLintRequest(template=self.build()) # type: ignore ) def build(self) -> TWorkflow: diff --git a/src/hera/workflows/container.py b/src/hera/workflows/container.py index 83b22b5dd..5be197534 100644 --- a/src/hera/workflows/container.py +++ b/src/hera/workflows/container.py @@ -46,6 +46,7 @@ class Container( def _build_container(self) -> _ModelContainer: """Builds the generated `Container` representation.""" + assert self.image return _ModelContainer( args=self.args, command=self.command, diff --git a/src/hera/workflows/container_set.py b/src/hera/workflows/container_set.py index ee8cf6874..33c101ef7 100644 --- a/src/hera/workflows/container_set.py +++ b/src/hera/workflows/container_set.py @@ -119,7 +119,9 @@ def _build_container_node(self) -> _ModelContainerNode: stdin=self.stdin, stdin_once=self.stdin_once, termination_message_path=self.termination_message_path, - termination_message_policy=self.termination_message_policy, + termination_message_policy=self.termination_message_policy.value + if self.termination_message_policy + else None, tty=self.tty, volume_devices=self.volume_devices, volume_mounts=self._build_volume_mounts(), @@ -132,7 +134,6 @@ class ContainerSet( ContainerMixin, TemplateMixin, CallableTemplateMixin, - ResourceMixin, VolumeMountMixin, ContextMixin, ): @@ -188,7 +189,6 @@ def _build_template(self) -> _ModelTemplate: pod_spec_patch=self.pod_spec_patch, priority=self.priority, priority_class_name=self.priority_class_name, - resource=self._build_resources(), retry_strategy=self.retry_strategy, scheduler_name=self.scheduler_name, security_context=self.pod_security_context, diff --git a/src/hera/workflows/cron_workflow.py b/src/hera/workflows/cron_workflow.py index d134ceca0..2846b0c45 100644 --- a/src/hera/workflows/cron_workflow.py +++ b/src/hera/workflows/cron_workflow.py @@ -4,7 +4,7 @@ for more on CronWorkflows. """ from pathlib import Path -from typing import Dict, Optional, Type, Union +from typing import Dict, Optional, Type, Union, cast try: from typing import Annotated, get_args, get_origin # type: ignore @@ -25,6 +25,7 @@ CronWorkflowStatus, LintCronWorkflowRequest, UpdateCronWorkflowRequest, + Workflow as _ModelWorkflow, ) from hera.workflows.protocol import TWorkflow from hera.workflows.workflow import Workflow, _WorkflowModelMapper @@ -92,7 +93,8 @@ def create(self) -> TWorkflow: # type: ignore assert self.namespace, "workflow namespace not defined" wf = self.workflows_service.create_cron_workflow( - CreateCronWorkflowRequest(cron_workflow=self.build()), namespace=self.namespace + CreateCronWorkflowRequest(cron_workflow=self.build()), # type: ignore + namespace=self.namespace, ) # set the name on the object so that we can do a get/update later self.name = wf.metadata.name @@ -126,7 +128,7 @@ def update(self) -> TWorkflow: return self.create() return self.workflows_service.update_cron_workflow( self.name, - UpdateCronWorkflowRequest(cron_workflow=template), + UpdateCronWorkflowRequest(cron_workflow=template), # type: ignore namespace=self.namespace, ) @@ -135,14 +137,15 @@ def lint(self) -> TWorkflow: assert self.workflows_service, "workflow service not initialized" assert self.namespace, "workflow namespace not defined" return self.workflows_service.lint_cron_workflow( - LintCronWorkflowRequest(cron_workflow=self.build()), namespace=self.namespace + LintCronWorkflowRequest(cron_workflow=self.build()), # type: ignore + namespace=self.namespace, ) def build(self) -> TWorkflow: """Builds the CronWorkflow and its components into an Argo schema CronWorkflow object.""" self = self._dispatch_hooks() - model_workflow = super().build() + model_workflow = cast(_ModelWorkflow, super().build()) model_cron_workflow = _ModelCronWorkflow( metadata=model_workflow.metadata, spec=CronWorkflowSpec( diff --git a/src/hera/workflows/http_template.py b/src/hera/workflows/http_template.py index aa14ad14c..ebf6ad051 100644 --- a/src/hera/workflows/http_template.py +++ b/src/hera/workflows/http_template.py @@ -6,7 +6,7 @@ HTTP as _ModelHTTP, HTTPBodySource, Template as _ModelTemplate, - V1HTTPHeader as HTTPHeader, + V1alpha1HTTPHeader as HTTPHeader, ) diff --git a/src/hera/workflows/metrics.py b/src/hera/workflows/metrics.py index e6d52a0de..0fbe4b961 100644 --- a/src/hera/workflows/metrics.py +++ b/src/hera/workflows/metrics.py @@ -121,7 +121,7 @@ def _build_metric(self) -> _ModelPrometheus: gauge=_ModelGauge(realtime=self.gauge.realtime, value=self.gauge.value) if self.gauge else None, help=self.help, histogram=_ModelHistogram( - buckets=self.histogram.buckets, + buckets=self.histogram._build_buckets(), value=self.histogram.value, ) if self.histogram diff --git a/src/hera/workflows/models/eventsource.py b/src/hera/workflows/models/eventsource.py index 590725380..ef39cc451 100644 --- a/src/hera/workflows/models/eventsource.py +++ b/src/hera/workflows/models/eventsource.py @@ -5,6 +5,8 @@ from typing import Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from .io.argoproj.events import v1alpha1 @@ -16,17 +18,18 @@ class EventSourceDeletedResponse(BaseModel): class LogEntry(BaseModel): - event_name: Optional[str] = Field( - default=None, - alias="eventName", - title="optional - the event name (e.g. `example`)", - ) - event_source_name: Optional[str] = Field(default=None, alias="eventSourceName") - event_source_type: Optional[str] = Field( - default=None, - alias="eventSourceType", - title="optional - the event source type (e.g. `webhook`)", - ) + event_name: Annotated[ + Optional[str], + Field(alias="eventName", title="optional - the event name (e.g. `example`)"), + ] = None + event_source_name: Annotated[Optional[str], Field(alias="eventSourceName")] = None + event_source_type: Annotated[ + Optional[str], + Field( + alias="eventSourceType", + title="optional - the event source type (e.g. `webhook`)", + ), + ] = None level: Optional[str] = None msg: Optional[str] = None namespace: Optional[str] = None @@ -34,7 +37,7 @@ class LogEntry(BaseModel): class CreateEventSourceRequest(BaseModel): - event_source: Optional[v1alpha1.EventSource] = Field(default=None, alias="eventSource") + event_source: Annotated[Optional[v1alpha1.EventSource], Field(alias="eventSource")] = None namespace: Optional[str] = None @@ -44,6 +47,6 @@ class EventSourceWatchEvent(BaseModel): class UpdateEventSourceRequest(BaseModel): - event_source: Optional[v1alpha1.EventSource] = Field(default=None, alias="eventSource") + event_source: Annotated[Optional[v1alpha1.EventSource], Field(alias="eventSource")] = None name: Optional[str] = None namespace: Optional[str] = None diff --git a/src/hera/workflows/models/eventsource.pyi b/src/hera/workflows/models/eventsource.pyi deleted file mode 100644 index a8ad2eef6..000000000 --- a/src/hera/workflows/models/eventsource.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Optional - -from hera.shared._pydantic import ( - BaseModel as BaseModel, - Field as Field, -) - -from .io.argoproj.events import v1alpha1 as v1alpha1 -from .io.k8s.apimachinery.pkg.apis.meta import v1 as v1 - -class EventSourceDeletedResponse(BaseModel): ... - -class LogEntry(BaseModel): - event_name: Optional[str] - event_source_name: Optional[str] - event_source_type: Optional[str] - level: Optional[str] - msg: Optional[str] - namespace: Optional[str] - time: Optional[v1.Time] - -class CreateEventSourceRequest(BaseModel): - event_source: Optional[v1alpha1.EventSource] - namespace: Optional[str] - -class EventSourceWatchEvent(BaseModel): - object: Optional[v1alpha1.EventSource] - type: Optional[str] - -class UpdateEventSourceRequest(BaseModel): - event_source: Optional[v1alpha1.EventSource] - name: Optional[str] - namespace: Optional[str] diff --git a/src/hera/workflows/models/google/protobuf.pyi b/src/hera/workflows/models/google/protobuf.pyi deleted file mode 100644 index 8b3b94c4f..000000000 --- a/src/hera/workflows/models/google/protobuf.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from typing import Optional - -from hera.shared._pydantic import BaseModel as BaseModel - -class Any(BaseModel): - type_url: Optional[str] - value: Optional[str] diff --git a/src/hera/workflows/models/grpc/gateway/runtime.pyi b/src/hera/workflows/models/grpc/gateway/runtime.pyi deleted file mode 100644 index c032edf27..000000000 --- a/src/hera/workflows/models/grpc/gateway/runtime.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from typing import List, Optional - -from hera.shared._pydantic import BaseModel as BaseModel - -from ...google import protobuf as protobuf - -class Error(BaseModel): - code: Optional[int] - details: Optional[List[protobuf.Any]] - error: Optional[str] - message: Optional[str] - -class StreamError(BaseModel): - details: Optional[List[protobuf.Any]] - grpc_code: Optional[int] - http_code: Optional[int] - http_status: Optional[str] - message: Optional[str] diff --git a/src/hera/workflows/models/io/argoproj/events/v1alpha1.py b/src/hera/workflows/models/io/argoproj/events/v1alpha1.py index 5f31f1388..164115823 100644 --- a/src/hera/workflows/models/io/argoproj/events/v1alpha1.py +++ b/src/hera/workflows/models/io/argoproj/events/v1alpha1.py @@ -5,289 +5,385 @@ from typing import Dict, List, Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field -from ...k8s.api.core import v1 -from ...k8s.apimachinery.pkg.apis.meta import v1 as v1_1 +from ...k8s.api.core import v1 as v1_1 +from ...k8s.apimachinery.pkg.apis.meta import v1 class AMQPConsumeConfig(BaseModel): - auto_ack: Optional[bool] = Field( - default=None, - alias="autoAck", - title=( - "AutoAck when true, the server will acknowledge deliveries to this consumer" - " prior to writing\nthe delivery to the network\n+optional" - ), - ) - consumer_tag: Optional[str] = Field( - default=None, - alias="consumerTag", - title=("ConsumerTag is the identity of the consumer included in every" " delivery\n+optional"), - ) - exclusive: Optional[bool] = Field( - default=None, - title=( - "Exclusive when true, the server will ensure that this is the sole consumer" " from this queue\n+optional" - ), - ) - no_local: Optional[bool] = Field( - default=None, - alias="noLocal", - title="NoLocal flag is not supported by RabbitMQ\n+optional", - ) - no_wait: Optional[bool] = Field( - default=None, - alias="noWait", - title=( - "NowWait when true, do not wait for the server to confirm the request and" - " immediately begin deliveries\n+optional" - ), - ) + auto_ack: Annotated[ + Optional[bool], + Field( + alias="autoAck", + title=( + "AutoAck when true, the server will acknowledge deliveries to this" + " consumer prior to writing\nthe delivery to the network\n+optional" + ), + ), + ] = None + consumer_tag: Annotated[ + Optional[str], + Field( + alias="consumerTag", + title=("ConsumerTag is the identity of the consumer included in every" " delivery\n+optional"), + ), + ] = None + exclusive: Annotated[ + Optional[bool], + Field( + title=( + "Exclusive when true, the server will ensure that this is the sole" + " consumer from this queue\n+optional" + ) + ), + ] = None + no_local: Annotated[ + Optional[bool], + Field( + alias="noLocal", + title="NoLocal flag is not supported by RabbitMQ\n+optional", + ), + ] = None + no_wait: Annotated[ + Optional[bool], + Field( + alias="noWait", + title=( + "NowWait when true, do not wait for the server to confirm the request" + " and immediately begin deliveries\n+optional" + ), + ), + ] = None class AMQPExchangeDeclareConfig(BaseModel): - auto_delete: Optional[bool] = Field( - default=None, - alias="autoDelete", - title="AutoDelete removes the exchange when no bindings are active\n+optional", - ) - durable: Optional[bool] = Field( - default=None, - title="Durable keeps the exchange also after the server restarts\n+optional", - ) - internal: Optional[bool] = Field(default=None, title="Internal when true does not accept publishings\n+optional") - no_wait: Optional[bool] = Field( - default=None, - alias="noWait", - title=("NowWait when true does not wait for a confirmation from the" " server\n+optional"), - ) + auto_delete: Annotated[ + Optional[bool], + Field( + alias="autoDelete", + title=("AutoDelete removes the exchange when no bindings are active\n+optional"), + ), + ] = None + durable: Annotated[ + Optional[bool], + Field(title="Durable keeps the exchange also after the server restarts\n+optional"), + ] = None + internal: Annotated[ + Optional[bool], + Field(title="Internal when true does not accept publishings\n+optional"), + ] = None + no_wait: Annotated[ + Optional[bool], + Field( + alias="noWait", + title=("NowWait when true does not wait for a confirmation from the" " server\n+optional"), + ), + ] = None + + +class EventSourceFilter(BaseModel): + expression: Optional[str] = None class AMQPQueueBindConfig(BaseModel): - no_wait: Optional[bool] = Field( - default=None, - alias="noWait", - title=( - "NowWait false and the queue could not be bound, the channel will be closed" " with an error\n+optional" + no_wait: Annotated[ + Optional[bool], + Field( + alias="noWait", + title=( + "NowWait false and the queue could not be bound, the channel will be" + " closed with an error\n+optional" + ), ), - ) + ] = None class AMQPQueueDeclareConfig(BaseModel): - arguments: Optional[str] = Field( - default=None, - title=( - 'Arguments of a queue (also known as "x-arguments") used for optional' " features and plugins\n+optional" - ), - ) - auto_delete: Optional[bool] = Field( - default=None, - alias="autoDelete", - title="AutoDelete removes the queue when no consumers are active\n+optional", - ) - durable: Optional[bool] = Field( - default=None, - title="Durable keeps the queue also after the server restarts\n+optional", - ) - exclusive: Optional[bool] = Field( - default=None, - title=( - "Exclusive sets the queues to be accessible only by the connection that" - " declares them and will be\ndeleted wgen the connection closes\n+optional" - ), - ) - name: Optional[str] = Field( - default=None, - title=("Name of the queue. If empty the server auto-generates a unique name for" " this queue\n+optional"), - ) - no_wait: Optional[bool] = Field( - default=None, - alias="noWait", - title=("NowWait when true, the queue assumes to be declared on the" " server\n+optional"), - ) + arguments: Annotated[ + Optional[str], + Field( + title=( + 'Arguments of a queue (also known as "x-arguments") used for optional' + " features and plugins\n+optional" + ) + ), + ] = None + auto_delete: Annotated[ + Optional[bool], + Field( + alias="autoDelete", + title=("AutoDelete removes the queue when no consumers are active\n+optional"), + ), + ] = None + durable: Annotated[ + Optional[bool], + Field(title="Durable keeps the queue also after the server restarts\n+optional"), + ] = None + exclusive: Annotated[ + Optional[bool], + Field( + title=( + "Exclusive sets the queues to be accessible only by the connection that" + " declares them and will be\ndeleted wgen the connection" + " closes\n+optional" + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + title=("Name of the queue. If empty the server auto-generates a unique name" " for this queue\n+optional") + ), + ] = None + no_wait: Annotated[ + Optional[bool], + Field( + alias="noWait", + title=("NowWait when true, the queue assumes to be declared on the" " server\n+optional"), + ), + ] = None class Amount(BaseModel): value: Optional[str] = None +class FileArtifact(BaseModel): + path: Optional[str] = None + + +class Resource(BaseModel): + value: Optional[str] = None + + +class URLArtifact(BaseModel): + path: Annotated[Optional[str], Field(title="Path is the complete URL")] = None + verify_cert: Annotated[ + Optional[bool], + Field( + alias="verifyCert", + title="VerifyCert decides whether the connection is secure or not", + ), + ] = None + + +class Int64OrString(BaseModel): + int64_val: Annotated[Optional[str], Field(alias="int64Val")] = None + str_val: Annotated[Optional[str], Field(alias="strVal")] = None + type: Optional[str] = None + + class BitbucketRepository(BaseModel): - owner: Optional[str] = Field(default=None, title="Owner is the owner of the repository") - repository_slug: Optional[str] = Field( - default=None, - alias="repositorySlug", - title=( - "RepositorySlug is a URL-friendly version of a repository name," - " automatically generated by Bitbucket for use in the URL" + owner: Annotated[Optional[str], Field(title="Owner is the owner of the repository")] = None + repository_slug: Annotated[ + Optional[str], + Field( + alias="repositorySlug", + title=( + "RepositorySlug is a URL-friendly version of a repository name," + " automatically generated by Bitbucket for use in the URL" + ), ), - ) + ] = None class BitbucketServerRepository(BaseModel): - project_key: Optional[str] = Field( - default=None, - alias="projectKey", - title="ProjectKey is the key of project for which integration needs to set up", - ) - repository_slug: Optional[str] = Field( - default=None, - alias="repositorySlug", - title=("RepositorySlug is the slug of the repository for which integration needs" " to set up"), - ) + project_key: Annotated[ + Optional[str], + Field( + alias="projectKey", + title=("ProjectKey is the key of project for which integration needs to set up"), + ), + ] = None + repository_slug: Annotated[ + Optional[str], + Field( + alias="repositorySlug", + title=("RepositorySlug is the slug of the repository for which integration" " needs to set up"), + ), + ] = None class CatchupConfiguration(BaseModel): - enabled: Optional[bool] = Field( - default=None, - title=("Enabled enables to triggered the missed schedule when eventsource restarts"), - ) - max_duration: Optional[str] = Field( - default=None, - alias="maxDuration", - title="MaxDuration holds max catchup duration", - ) + enabled: Annotated[ + Optional[bool], + Field(title=("Enabled enables to triggered the missed schedule when eventsource" " restarts")), + ] = None + max_duration: Annotated[ + Optional[str], + Field(alias="maxDuration", title="MaxDuration holds max catchup duration"), + ] = None class ConditionsResetByTime(BaseModel): - cron: Optional[str] = Field( - default=None, - title=("Cron is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron"), - ) - timezone: Optional[str] = Field(default=None, title="+optional") - - -class ConditionsResetCriteria(BaseModel): - by_time: Optional[ConditionsResetByTime] = Field( - default=None, - alias="byTime", - title=("Schedule is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron"), - ) + cron: Annotated[ + Optional[str], + Field(title=("Cron is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron")), + ] = None + timezone: Annotated[Optional[str], Field(title="+optional")] = None class ConfigMapPersistence(BaseModel): - create_if_not_exist: Optional[bool] = Field( - default=None, - alias="createIfNotExist", - title="CreateIfNotExist will create configmap if it doesn't exists", - ) - name: Optional[str] = Field(default=None, title="Name of the configmap") + create_if_not_exist: Annotated[ + Optional[bool], + Field( + alias="createIfNotExist", + title="CreateIfNotExist will create configmap if it doesn't exists", + ), + ] = None + name: Annotated[Optional[str], Field(title="Name of the configmap")] = None class DataFilter(BaseModel): - comparator: Optional[str] = Field( - default=None, - description=( - 'Comparator compares the event data with a user given value.\nCan be ">=",' - ' ">", "=", "!=", "<", or "<=".\nIs optional, and if left blank treated as' - ' equality "=".' - ), - ) - path: Optional[str] = Field( - default=None, - description=( - "Path is the JSONPath of the event's (JSON decoded) data key\nPath is a" - " series of keys separated by a dot. A key may contain wildcard characters" - " '*' and '?'.\nTo access an array value use the index as the key. The dot" - " and wildcard characters can be escaped with '\\\\'.\nSee" - " https://github.com/tidwall/gjson#path-syntax for more information on how" - " to use this." - ), - ) - template: Optional[str] = Field( - default=None, - title=( - "Template is a go-template for extracting a string from the event's" - " data.\nA Template is evaluated with provided path, type and value.\nThe" - " templating follows the standard go-template syntax as well as sprig's" - " extra functions.\nSee https://pkg.go.dev/text/template and" - " https://masterminds.github.io/sprig/" - ), - ) - type: Optional[str] = Field(default=None, title="Type contains the JSON type of the data") - value: Optional[List[str]] = Field( - default=None, - title=( - "Value is the allowed string values for this key\nBooleans are passed using" - " strconv.ParseBool()\nNumbers are parsed using as float64 using" - " strconv.ParseFloat()\nStrings are taken as is\nNils this value is ignored" - ), - ) + comparator: Annotated[ + Optional[str], + Field( + description=( + "Comparator compares the event data with a user given value.\nCan be" + ' ">=", ">", "=", "!=", "<", or "<=".\nIs optional, and if left blank' + ' treated as equality "=".' + ) + ), + ] = None + path: Annotated[ + Optional[str], + Field( + description=( + "Path is the JSONPath of the event's (JSON decoded) data key\nPath is a" + " series of keys separated by a dot. A key may contain wildcard" + " characters '*' and '?'.\nTo access an array value use the index as" + " the key. The dot and wildcard characters can be escaped with" + " '\\\\'.\nSee https://github.com/tidwall/gjson#path-syntax for more" + " information on how to use this." + ) + ), + ] = None + template: Annotated[ + Optional[str], + Field( + title=( + "Template is a go-template for extracting a string from the event's" + " data.\nA Template is evaluated with provided path, type and" + " value.\nThe templating follows the standard go-template syntax as" + " well as sprig's extra functions.\nSee" + " https://pkg.go.dev/text/template and" + " https://masterminds.github.io/sprig/" + ) + ), + ] = None + type: Annotated[Optional[str], Field(title="Type contains the JSON type of the data")] = None + value: Annotated[ + Optional[List[str]], + Field( + title=( + "Value is the allowed string values for this key\nBooleans are passed" + " using strconv.ParseBool()\nNumbers are parsed using as float64 using" + " strconv.ParseFloat()\nStrings are taken as is\nNils this value is" + " ignored" + ) + ), + ] = None class EventDependencyTransformer(BaseModel): - jq: Optional[str] = Field( - default=None, - title="JQ holds the jq command applied for transformation\n+optional", - ) - script: Optional[str] = Field( - default=None, - title="Script refers to a Lua script used to transform the event\n+optional", - ) - + jq: Annotated[ + Optional[str], + Field(title="JQ holds the jq command applied for transformation\n+optional"), + ] = None + script: Annotated[ + Optional[str], + Field(title="Script refers to a Lua script used to transform the event\n+optional"), + ] = None -class EventPersistence(BaseModel): - catchup: Optional[CatchupConfiguration] = Field( - default=None, - title=("Catchup enables to triggered the missed schedule when eventsource restarts"), - ) - config_map: Optional[ConfigMapPersistence] = Field( - default=None, - alias="configMap", - title="ConfigMap holds configmap details for persistence", - ) - -class EventSourceFilter(BaseModel): - expression: Optional[str] = None +class TimeFilter(BaseModel): + start: Annotated[ + Optional[str], + Field( + description=( + "Start is the beginning of a time window in UTC.\nBefore this time," + " events for this dependency are ignored.\nFormat is hh:mm:ss." + ) + ), + ] = None + stop: Annotated[ + Optional[str], + Field( + description=( + "Stop is the end of a time window in UTC.\nAfter or equal to this time," + " events for this dependency are ignored and\nFormat is hh:mm:ss.\nIf" + " it is smaller than Start, it is treated as next day of Start\n(e.g.:" + " 22:00:00-01:00:00 means 22:00:00-25:00:00)." + ) + ), + ] = None -class FileArtifact(BaseModel): - path: Optional[str] = None +class WatchPathConfig(BaseModel): + directory: Annotated[Optional[str], Field(title="Directory to watch for events")] = None + path: Annotated[ + Optional[str], + Field(title=("Path is relative path of object to watch with respect to the directory")), + ] = None + path_regexp: Annotated[ + Optional[str], + Field( + alias="pathRegexp", + title=("PathRegexp is regexp of relative path of object to watch with respect" " to the directory"), + ), + ] = None class GitRemoteConfig(BaseModel): - name: Optional[str] = Field(default=None, description="Name of the remote to fetch from.") - urls: Optional[List[str]] = Field( - default=None, - description=( - "URLs the URLs of a remote repository. It must be non-empty. Fetch" - " will\nalways use the first URL, while push will use all of them." + name: Annotated[Optional[str], Field(description="Name of the remote to fetch from.")] = None + urls: Annotated[ + Optional[List[str]], + Field( + description=( + "URLs the URLs of a remote repository. It must be non-empty. Fetch" + " will\nalways use the first URL, while push will use all of them." + ) ), - ) - - -class Int64OrString(BaseModel): - int64_val: Optional[str] = Field(default=None, alias="int64Val") - str_val: Optional[str] = Field(default=None, alias="strVal") - type: Optional[str] = None + ] = None class KafkaConsumerGroup(BaseModel): - group_name: Optional[str] = Field(default=None, alias="groupName", title="The name for the consumer group to use") - oldest: Optional[bool] = Field( - default=None, - title=( - "When starting up a new group do we want to start from the oldest event" - " (true) or the newest event (false), defaults to false\n+optional" - ), - ) - rebalance_strategy: Optional[str] = Field( - default=None, - alias="rebalanceStrategy", - title=("Rebalance strategy can be one of: sticky, roundrobin, range. Range is the" " default.\n+optional"), - ) + group_name: Annotated[ + Optional[str], + Field(alias="groupName", title="The name for the consumer group to use"), + ] = None + oldest: Annotated[ + Optional[bool], + Field( + title=( + "When starting up a new group do we want to start from the oldest event" + " (true) or the newest event (false), defaults to false\n+optional" + ) + ), + ] = None + rebalance_strategy: Annotated[ + Optional[str], + Field( + alias="rebalanceStrategy", + title=("Rebalance strategy can be one of: sticky, roundrobin, range. Range is" " the default.\n+optional"), + ), + ] = None class LogTrigger(BaseModel): - interval_seconds: Optional[str] = Field( - default=None, - alias="intervalSeconds", - title=( - "Only print messages every interval. Useful to prevent logging too much" - " data for busy events.\n+optional" + interval_seconds: Annotated[ + Optional[str], + Field( + alias="intervalSeconds", + title=( + "Only print messages every interval. Useful to prevent logging too much" + " data for busy events.\n+optional" + ), ), - ) + ] = None class Metadata(BaseModel): @@ -296,32 +392,33 @@ class Metadata(BaseModel): class OwnedRepositories(BaseModel): - names: Optional[List[str]] = Field(default=None, title="Repository names") - owner: Optional[str] = Field(default=None, title="Organization or user name") + names: Annotated[Optional[List[str]], Field(title="Repository names")] = None + owner: Annotated[Optional[str], Field(title="Organization or user name")] = None class PayloadField(BaseModel): - name: Optional[str] = Field(default=None, description="Name acts as key that holds the value at the path.") - path: Optional[str] = Field( - default=None, - description=( - "Path is the JSONPath of the event's (JSON decoded) data key\nPath is a" - " series of keys separated by a dot. A key may contain wildcard characters" - " '*' and '?'.\nTo access an array value use the index as the key. The dot" - " and wildcard characters can be escaped with '\\\\'.\nSee" - " https://github.com/tidwall/gjson#path-syntax for more information on how" - " to use this." - ), - ) + name: Annotated[ + Optional[str], + Field(description="Name acts as key that holds the value at the path."), + ] = None + path: Annotated[ + Optional[str], + Field( + description=( + "Path is the JSONPath of the event's (JSON decoded) data key\nPath is a" + " series of keys separated by a dot. A key may contain wildcard" + " characters '*' and '?'.\nTo access an array value use the index as" + " the key. The dot and wildcard characters can be escaped with" + " '\\\\'.\nSee https://github.com/tidwall/gjson#path-syntax for more" + " information on how to use this." + ) + ), + ] = None class RateLimit(BaseModel): - requests_per_unit: Optional[int] = Field(default=None, alias="requestsPerUnit") - unit: Optional[str] = Field(default=None, title="Defaults to Second") - - -class Resource(BaseModel): - value: Optional[str] = None + requests_per_unit: Annotated[Optional[int], Field(alias="requestsPerUnit")] = None + unit: Annotated[Optional[str], Field(title="Defaults to Second")] = None class S3Bucket(BaseModel): @@ -335,16 +432,18 @@ class S3Filter(BaseModel): class Selector(BaseModel): - key: Optional[str] = Field(default=None, title="Key name") - operation: Optional[str] = Field( - default=None, - title=( - "Supported operations like ==, !=, <=, >= etc.\nDefaults to ==.\nRefer" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" - " for more io.argoproj.workflow.v1alpha1.\n+optional" + key: Annotated[Optional[str], Field(title="Key name")] = None + operation: Annotated[ + Optional[str], + Field( + title=( + "Supported operations like ==, !=, <=, >= etc.\nDefaults to ==.\nRefer" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" + " for more io.argoproj.workflow.v1alpha1.\n+optional" + ) ), - ) - value: Optional[str] = Field(default=None, title="Value") + ] = None + value: Annotated[Optional[str], Field(title="Value")] = None class StatusPolicy(BaseModel): @@ -356,523 +455,784 @@ class StorageGridFilter(BaseModel): suffix: Optional[str] = None -class TimeFilter(BaseModel): - start: Optional[str] = Field( - default=None, - description=( - "Start is the beginning of a time window in UTC.\nBefore this time, events" - " for this dependency are ignored.\nFormat is hh:mm:ss." - ), - ) - stop: Optional[str] = Field( - default=None, - description=( - "Stop is the end of a time window in UTC.\nAfter or equal to this time," - " events for this dependency are ignored and\nFormat is hh:mm:ss.\nIf it is" - " smaller than Start, it is treated as next day of Start\n(e.g.:" - " 22:00:00-01:00:00 means 22:00:00-25:00:00)." - ), - ) - - class TriggerParameterSource(BaseModel): - context_key: Optional[str] = Field( - default=None, - alias="contextKey", - description=( - "ContextKey is the JSONPath of the event's (JSON decoded) context" - " key\nContextKey is a series of keys separated by a dot. A key may contain" - " wildcard characters '*' and '?'.\nTo access an array value use the index" - " as the key. The dot and wildcard characters can be escaped with" - " '\\\\'.\nSee https://github.com/tidwall/gjson#path-syntax for more" - " information on how to use this." - ), - ) - context_template: Optional[str] = Field( - default=None, - alias="contextTemplate", - title=( - "ContextTemplate is a go-template for extracting a string from the event's" - " context.\nIf a ContextTemplate is provided with a ContextKey, the" - " template will be evaluated first and fallback to the ContextKey.\nThe" - " templating follows the standard go-template syntax as well as sprig's" - " extra functions.\nSee https://pkg.go.dev/text/template and" - " https://masterminds.github.io/sprig/" - ), - ) - data_key: Optional[str] = Field( - default=None, - alias="dataKey", - description=( - "DataKey is the JSONPath of the event's (JSON decoded) data key\nDataKey is" - " a series of keys separated by a dot. A key may contain wildcard" - " characters '*' and '?'.\nTo access an array value use the index as the" - " key. The dot and wildcard characters can be escaped with '\\\\'.\nSee" - " https://github.com/tidwall/gjson#path-syntax for more information on how" - " to use this." - ), - ) - data_template: Optional[str] = Field( - default=None, - alias="dataTemplate", - title=( - "DataTemplate is a go-template for extracting a string from the event's" - " data.\nIf a DataTemplate is provided with a DataKey, the template will be" - " evaluated first and fallback to the DataKey.\nThe templating follows the" - " standard go-template syntax as well as sprig's extra functions.\nSee" - " https://pkg.go.dev/text/template and https://masterminds.github.io/sprig/" - ), - ) - dependency_name: Optional[str] = Field( - default=None, - alias="dependencyName", - description=( - "DependencyName refers to the name of the dependency. The event which is" - " stored for this dependency is used as payload\nfor the parameterization." - " Make sure to refer to one of the dependencies you have defined under" - " Dependencies list." - ), - ) - value: Optional[str] = Field( - default=None, - description=( - "Value is the default literal value to use for this parameter source\nThis" - " is only used if the DataKey is invalid.\nIf the DataKey is invalid and" - " this is not defined, this param source will produce an error." - ), - ) + context_key: Annotated[ + Optional[str], + Field( + alias="contextKey", + description=( + "ContextKey is the JSONPath of the event's (JSON decoded) context" + " key\nContextKey is a series of keys separated by a dot. A key may" + " contain wildcard characters '*' and '?'.\nTo access an array value" + " use the index as the key. The dot and wildcard characters can be" + " escaped with '\\\\'.\nSee" + " https://github.com/tidwall/gjson#path-syntax for more information on" + " how to use this." + ), + ), + ] = None + context_template: Annotated[ + Optional[str], + Field( + alias="contextTemplate", + title=( + "ContextTemplate is a go-template for extracting a string from the" + " event's context.\nIf a ContextTemplate is provided with a ContextKey," + " the template will be evaluated first and fallback to the" + " ContextKey.\nThe templating follows the standard go-template syntax" + " as well as sprig's extra functions.\nSee" + " https://pkg.go.dev/text/template and" + " https://masterminds.github.io/sprig/" + ), + ), + ] = None + data_key: Annotated[ + Optional[str], + Field( + alias="dataKey", + description=( + "DataKey is the JSONPath of the event's (JSON decoded) data" + " key\nDataKey is a series of keys separated by a dot. A key may" + " contain wildcard characters '*' and '?'.\nTo access an array value" + " use the index as the key. The dot and wildcard characters can be" + " escaped with '\\\\'.\nSee" + " https://github.com/tidwall/gjson#path-syntax for more information on" + " how to use this." + ), + ), + ] = None + data_template: Annotated[ + Optional[str], + Field( + alias="dataTemplate", + title=( + "DataTemplate is a go-template for extracting a string from the event's" + " data.\nIf a DataTemplate is provided with a DataKey, the template" + " will be evaluated first and fallback to the DataKey.\nThe templating" + " follows the standard go-template syntax as well as sprig's extra" + " functions.\nSee https://pkg.go.dev/text/template and" + " https://masterminds.github.io/sprig/" + ), + ), + ] = None + dependency_name: Annotated[ + Optional[str], + Field( + alias="dependencyName", + description=( + "DependencyName refers to the name of the dependency. The event which" + " is stored for this dependency is used as payload\nfor the" + " parameterization. Make sure to refer to one of the dependencies you" + " have defined under Dependencies list." + ), + ), + ] = None + value: Annotated[ + Optional[str], + Field( + description=( + "Value is the default literal value to use for this parameter" + " source\nThis is only used if the DataKey is invalid.\nIf the DataKey" + " is invalid and this is not defined, this param source will produce an" + " error." + ) + ), + ] = None -class URLArtifact(BaseModel): - path: Optional[str] = Field(default=None, title="Path is the complete URL") - verify_cert: Optional[bool] = Field( - default=None, - alias="verifyCert", - title="VerifyCert decides whether the connection is secure or not", - ) +class Condition(BaseModel): + last_transition_time: Annotated[ + Optional[v1.Time], + Field( + alias="lastTransitionTime", + title=("Last time the condition transitioned from one status to" " another.\n+optional"), + ), + ] = None + message: Annotated[ + Optional[str], + Field(title=("Human-readable message indicating details about last" " transition.\n+optional")), + ] = None + reason: Annotated[ + Optional[str], + Field( + title=( + "Unique, this should be a short, machine understandable string that" + " gives the reason\nfor condition's last transition. For example," + ' "ImageNotFound"\n+optional' + ) + ), + ] = None + status: Annotated[ + Optional[str], + Field(title="Condition status, True, False or Unknown.\n+required"), + ] = None + type: Annotated[Optional[str], Field(title="Condition type.\n+required")] = None -class WatchPathConfig(BaseModel): - directory: Optional[str] = Field(default=None, title="Directory to watch for events") - path: Optional[str] = Field( - default=None, - title="Path is relative path of object to watch with respect to the directory", - ) - path_regexp: Optional[str] = Field( - default=None, - alias="pathRegexp", - title=("PathRegexp is regexp of relative path of object to watch with respect to" " the directory"), - ) +class EventContext(BaseModel): + datacontenttype: Annotated[ + Optional[str], + Field(description=("DataContentType - A MIME (RFC2046) string describing the media type of" " `data`.")), + ] = None + id: Annotated[ + Optional[str], + Field(description=("ID of the event; must be non-empty and unique within the scope of the" " producer.")), + ] = None + source: Annotated[ + Optional[str], + Field(description="Source - A URI describing the event producer."), + ] = None + specversion: Annotated[ + Optional[str], + Field( + description=( + "SpecVersion - The version of the CloudEvents specification used by the" + " io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + subject: Annotated[ + Optional[str], + Field(title=("Subject - The subject of the event in the context of the event" " producer")), + ] = None + time: Annotated[ + Optional[v1.Time], + Field(description="Time - A Timestamp when the event happened."), + ] = None + type: Annotated[ + Optional[str], + Field(description="Type - The type of the occurrence which has happened."), + ] = None -class AzureEventsHubEventSource(BaseModel): - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - fqdn: Optional[str] = Field( - default=None, - title=( - "FQDN of the EventHubs namespace you created\nMore info at" - " https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string" - ), - ) - hub_name: Optional[str] = Field(default=None, alias="hubName", title="Event Hub path/name") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - shared_access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sharedAccessKey", - title="SharedAccessKey is the generated value of the key", - ) - shared_access_key_name: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sharedAccessKeyName", - title=("SharedAccessKeyName is the name you chose for your application's SAS keys"), - ) +class ResourceFilter(BaseModel): + after_start: Annotated[ + Optional[bool], + Field( + alias="afterStart", + title=( + "If the resource is created after the start time then the event is" " treated as valid.\n+optional" + ), + ), + ] = None + created_by: Annotated[ + Optional[v1.Time], + Field( + alias="createdBy", + title=( + "If resource is created before the specified time then the event is" " treated as valid.\n+optional" + ), + ), + ] = None + fields: Annotated[ + Optional[List[Selector]], + Field( + title=( + "Fields provide field filters similar to K8s field selector\n(see" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/).\nUnlike" + " K8s field selector, it supports arbitrary fileds like" + ' "spec.serviceAccountName",\nand the value could be a string or a' + ' regex.\nSame as K8s field selector, operator "=", "==" and "!=" are' + " supported.\n+optional" + ) + ), + ] = None + labels: Annotated[ + Optional[List[Selector]], + Field( + title=( + "Labels provide listing options to K8s API to watch resource/s.\nRefer" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/label-selectors/" + " for more io.argoproj.workflow.v1alpha1.\n+optional" + ) + ), + ] = None + prefix: Annotated[ + Optional[str], + Field(title="Prefix filter is applied on the resource name.\n+optional"), + ] = None -class Backoff(BaseModel): - duration: Optional[Int64OrString] = Field( - default=None, - title=('The initial duration in nanoseconds or strings like "1s", "3m"\n+optional'), - ) - factor: Optional[Amount] = Field(default=None, title="Duration is multiplied by factor each iteration\n+optional") - jitter: Optional[Amount] = Field(default=None, title="The amount of jitter applied each iteration\n+optional") - steps: Optional[int] = Field(default=None, title="Exit with error after this many steps\n+optional") +class AzureEventsHubEventSource(BaseModel): + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + fqdn: Annotated[ + Optional[str], + Field( + title=( + "FQDN of the EventHubs namespace you created\nMore info at" + " https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string" + ) + ), + ] = None + hub_name: Annotated[Optional[str], Field(alias="hubName", title="Event Hub path/name")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + shared_access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sharedAccessKey", + title="SharedAccessKey is the generated value of the key", + ), + ] = None + shared_access_key_name: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sharedAccessKeyName", + title=("SharedAccessKeyName is the name you chose for your application's SAS" " keys"), + ), + ] = None class BasicAuth(BaseModel): - password: Optional[v1.SecretKeySelector] = Field( - default=None, - description=("Password refers to the Kubernetes secret that holds the password required" " for basic auth."), - ) - username: Optional[v1.SecretKeySelector] = Field( - default=None, - description=("Username refers to the Kubernetes secret that holds the username required" " for basic auth."), - ) + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + description=( + "Password refers to the Kubernetes secret that holds the password" " required for basic auth." + ) + ), + ] = None + username: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + description=( + "Username refers to the Kubernetes secret that holds the username" " required for basic auth." + ) + ), + ] = None class BitbucketBasicAuth(BaseModel): - password: Optional[v1.SecretKeySelector] = Field( - default=None, - description="Password refers to the K8s secret that holds the password.", - ) - username: Optional[v1.SecretKeySelector] = Field( - default=None, - description="Username refers to the K8s secret that holds the username.", - ) + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(description="Password refers to the K8s secret that holds the password."), + ] = None + username: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(description="Username refers to the K8s secret that holds the username."), + ] = None -class CalendarEventSource(BaseModel): - exclusion_dates: Optional[List[str]] = Field( - default=None, - alias="exclusionDates", - description=("ExclusionDates defines the list of DATE-TIME exceptions for recurring" " events."), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - interval: Optional[str] = Field( - default=None, - title=("Interval is a string that describes an interval duration, e.g. 1s, 30m," " 2h...\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - persistence: Optional[EventPersistence] = Field( - default=None, title="Persistence hold the configuration for event persistence" - ) - schedule: Optional[str] = Field( - default=None, - title=( - "Schedule is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron\n+optional" - ), - ) - timezone: Optional[str] = Field(default=None, title="Timezone in which to run the schedule\n+optional") +class GenericEventSource(BaseModel): + auth_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="authSecret", + title=("AuthSecret holds a secret selector that contains a bearer token for" " authentication\n+optional"), + ), + ] = None + config: Annotated[Optional[str], Field(title="Config is the event source configuration")] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + insecure: Annotated[Optional[bool], Field(description="Insecure determines the type of connection.")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + url: Annotated[ + Optional[str], + Field(description="URL of the gRPC server that implements the event source."), + ] = None -class Condition(BaseModel): - last_transition_time: Optional[v1_1.Time] = Field( - default=None, - alias="lastTransitionTime", - title=("Last time the condition transitioned from one status to" " another.\n+optional"), - ) - message: Optional[str] = Field( - default=None, - title=("Human-readable message indicating details about last" " transition.\n+optional"), - ) - reason: Optional[str] = Field( - default=None, - title=( - "Unique, this should be a short, machine understandable string that gives" - " the reason\nfor condition's last transition. For example," - ' "ImageNotFound"\n+optional' - ), - ) - status: Optional[str] = Field(default=None, title="Condition status, True, False or Unknown.\n+required") - type: Optional[str] = Field(default=None, title="Condition type.\n+required") +class GitCreds(BaseModel): + password: Optional[v1_1.SecretKeySelector] = None + username: Optional[v1_1.SecretKeySelector] = None -class EventContext(BaseModel): - datacontenttype: Optional[str] = Field( - default=None, - description=("DataContentType - A MIME (RFC2046) string describing the media type of" " `data`."), - ) - id: Optional[str] = Field( - default=None, - description=("ID of the event; must be non-empty and unique within the scope of the" " producer."), - ) - source: Optional[str] = Field(default=None, description="Source - A URI describing the event producer.") - specversion: Optional[str] = Field( - default=None, - description=( - "SpecVersion - The version of the CloudEvents specification used by the" " io.argoproj.workflow.v1alpha1." - ), - ) - subject: Optional[str] = Field( - default=None, - title="Subject - The subject of the event in the context of the event producer", - ) - time: Optional[v1_1.Time] = Field(default=None, description="Time - A Timestamp when the event happened.") - type: Optional[str] = Field( - default=None, - description="Type - The type of the occurrence which has happened.", - ) +class GithubAppCreds(BaseModel): + app_id: Annotated[ + Optional[str], + Field( + alias="appID", + title="AppID refers to the GitHub App ID for the application you created", + ), + ] = None + installation_id: Annotated[ + Optional[str], + Field( + alias="installationID", + title=("InstallationID refers to the Installation ID of the GitHub app you" " created and installed"), + ), + ] = None + private_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="privateKey", + title=("PrivateKey refers to a K8s secret containing the GitHub app" " private key"), + ), + ] = None -class ExprFilter(BaseModel): - expr: Optional[str] = Field( - default=None, - description=("Expr refers to the expression that determines the outcome of the filter."), - ) - fields: Optional[List[PayloadField]] = Field( - default=None, - description=("Fields refers to set of keys that refer to the paths within event payload."), - ) +class PubSubEventSource(BaseModel): + credential_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="credentialSecret", + title=( + "CredentialSecret references to the secret that contains JSON" + " credentials to access GCP.\nIf it is missing, it implicitly uses" + " Workload Identity to" + " access.\nhttps://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity\n+optional" + ), + ), + ] = None + delete_subscription_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteSubscriptionOnFinish", + title=( + "DeleteSubscriptionOnFinish determines whether to delete the GCP PubSub" + " subscription once the event source is stopped.\n+optional" + ), + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + project_id: Annotated[ + Optional[str], + Field( + alias="projectID", + title=( + "ProjectID is GCP project ID for the subscription.\nRequired if you run" + " Argo Events outside of GKE/GCE.\n(otherwise, the default value is its" + " project)\n+optional" + ), + ), + ] = None + subscription_id: Annotated[ + Optional[str], + Field( + alias="subscriptionID", + title=( + "SubscriptionID is ID of subscription.\nRequired if you use existing" + " subscription.\nThe default value will be auto generated hash based on" + " this eventsource setting, so the subscription\nmight be recreated" + " every time you update the setting, which has a possibility of event" + " loss.\n+optional" + ), + ), + ] = None + topic: Annotated[ + Optional[str], + Field( + title=( + "Topic to which the subscription should belongs.\nRequired if you want" + " the eventsource to create a new subscription.\nIf you specify this" + " field along with an existing subscription,\nit will be verified" + " whether it actually belongs to the specified topic.\n+optional" + ) + ), + ] = None + topic_project_id: Annotated[ + Optional[str], + Field( + alias="topicProjectID", + title=( + "TopicProjectID is GCP project ID for the topic.\nBy default, it is" " same as ProjectID.\n+optional" + ), + ), + ] = None -class FileEventSource(BaseModel): - event_type: Optional[str] = Field( - default=None, - alias="eventType", - title=( - "Type of file operations to watch\nRefer" - " https://github.com/fsnotify/fsnotify/blob/master/fsnotify.go for more" - " information" - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - polling: Optional[bool] = Field(default=None, title="Use polling instead of inotify") - watch_path_config: Optional[WatchPathConfig] = Field( - default=None, - alias="watchPathConfig", - title="WatchPathConfig contains configuration about the file path to watch", - ) +class SASLConfig(BaseModel): + mechanism: Annotated[ + Optional[str], + Field( + title=( + "SASLMechanism is the name of the enabled SASL mechanism.\nPossible" + " values: OAUTHBEARER, PLAIN (defaults to PLAIN).\n+optional" + ) + ), + ] = None + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Password for SASL/PLAIN authentication"), + ] = None + user: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + title=( + "User is the authentication identity (authcid) to present" + " for\nSASL/PLAIN or SASL/SCRAM authentication" + ) + ), + ] = None -class GenericEventSource(BaseModel): - auth_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authSecret", - title=("AuthSecret holds a secret selector that contains a bearer token for" " authentication\n+optional"), - ) - config: Optional[str] = Field(default=None, title="Config is the event source configuration") - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - insecure: Optional[bool] = Field(default=None, description="Insecure determines the type of connection.") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - url: Optional[str] = Field( - default=None, - description="URL of the gRPC server that implements the event source.", - ) +class SQSEventSource(BaseModel): + access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessKey", + title="AccessKey refers K8s secret containing aws access key", + ), + ] = None + dlq: Annotated[ + Optional[bool], + Field( + title=( + "DLQ specifies if a dead-letter queue is configured for messages that" + " can't be processed successfully.\nIf set to true, messages with" + " invalid payload won't be acknowledged to allow to forward them" + " farther to the dead-letter queue.\nThe default value is" + " false.\n+optional" + ) + ), + ] = None + endpoint: Annotated[ + Optional[str], + Field( + title=( + "Endpoint configures connection to a specific SQS endpoint instead of" " Amazons servers\n+optional" + ) + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + queue: Annotated[Optional[str], Field(title="Queue is AWS SQS queue to listen to for messages")] = None + queue_account_id: Annotated[ + Optional[str], + Field( + alias="queueAccountId", + title=("QueueAccountID is the ID of the account that created the queue to" " monitor\n+optional"), + ), + ] = None + region: Annotated[Optional[str], Field(title="Region is AWS region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), + ), + ] = None + secret_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="secretKey", + title="SecretKey refers K8s secret containing aws secret key", + ), + ] = None + session_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sessionToken", + title=( + "SessionToken refers to K8s secret containing AWS temporary" + " credentials(STS) session token\n+optional" + ), + ), + ] = None + wait_time_seconds: Annotated[ + Optional[str], + Field( + alias="waitTimeSeconds", + description=( + "WaitTimeSeconds is The duration (in seconds) for which the call waits" + " for a message to arrive\nin the queue before returning." + ), + ), + ] = None -class GitCreds(BaseModel): - password: Optional[v1.SecretKeySelector] = None - username: Optional[v1.SecretKeySelector] = None +class TLSConfig(BaseModel): + ca_cert_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="caCertSecret", + title="CACertSecret refers to the secret that contains the CA cert", + ), + ] = None + client_cert_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="clientCertSecret", + title="ClientCertSecret refers to the secret that contains the client cert", + ), + ] = None + client_key_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="clientKeySecret", + title="ClientKeySecret refers to the secret that contains the client key", + ), + ] = None + insecure_skip_verify: Annotated[ + Optional[bool], + Field( + alias="insecureSkipVerify", + title=( + "If true, skips creation of TLSConfig with certs and creates an empty" + " TLSConfig. (Defaults to false)\n+optional" + ), + ), + ] = None -class GithubAppCreds(BaseModel): - app_id: Optional[str] = Field( - default=None, - alias="appID", - title="AppID refers to the GitHub App ID for the application you created", - ) - installation_id: Optional[str] = Field( - default=None, - alias="installationID", - title=("InstallationID refers to the Installation ID of the GitHub app you created" " and installed"), - ) - private_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="privateKey", - title="PrivateKey refers to a K8s secret containing the GitHub app private key", - ) +class WebhookContext(BaseModel): + auth_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="authSecret", + title=("AuthSecret holds a secret selector that contains a bearer token for" " authentication\n+optional"), + ), + ] = None + endpoint: Annotated[Optional[str], Field(title="REST API endpoint")] = None + max_payload_size: Annotated[ + Optional[str], + Field( + alias="maxPayloadSize", + title=( + "MaxPayloadSize is the maximum webhook payload size that the server" + " will accept.\nRequests exceeding that limit will be rejected with" + ' "request too large" response.\nDefault value: 1048576' + " (1MB).\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + method: Annotated[ + Optional[str], + Field( + title=( + "Method is HTTP request method that indicates the desired action to be" + " performed for a given resource.\nSee RFC7231 Hypertext Transfer" + " Protocol (HTTP/1.1): Semantics and Content" + ) + ), + ] = None + port: Annotated[ + Optional[str], + Field(description="Port on which HTTP server is listening for incoming events."), + ] = None + server_cert_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="serverCertSecret", + description="ServerCertPath refers the file that contains the cert.", + ), + ] = None + server_key_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="serverKeySecret", + title="ServerKeyPath refers the file that contains private key", + ), + ] = None + url: Annotated[Optional[str], Field(description="URL is the url of the server.")] = None -class HDFSEventSource(BaseModel): - addresses: Optional[List[str]] = None - check_interval: Optional[str] = Field( - default=None, - alias="checkInterval", - title=( - "CheckInterval is a string that describes an interval duration to check the" - " directory state, e.g. 1s, 30m, 2h... (defaults to 1m)" - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - hdfs_user: Optional[str] = Field( - default=None, - alias="hdfsUser", - description=( - "HDFSUser is the user to access HDFS file system.\nIt is ignored if either" " ccache or keytab is used." - ), - ) - krb_c_cache_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbCCacheSecret", - description=( - "KrbCCacheSecret is the secret selector for Kerberos ccache\nEither ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_config_config_map: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="krbConfigConfigMap", - description=( - "KrbConfig is the configmap selector for Kerberos config as string\nIt must" - " be set if either ccache or keytab is used." - ), - ) - krb_keytab_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbKeytabSecret", - description=( - "KrbKeytabSecret is the secret selector for Kerberos keytab\nEither ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_realm: Optional[str] = Field( - default=None, - alias="krbRealm", - description=("KrbRealm is the Kerberos realm used with Kerberos keytab\nIt must be set" " if keytab is used."), - ) - krb_service_principal_name: Optional[str] = Field( - default=None, - alias="krbServicePrincipalName", - description=( - "KrbServicePrincipalName is the principal name of Kerberos service\nIt must" - " be set if either ccache or keytab is used." - ), - ) - krb_username: Optional[str] = Field( - default=None, - alias="krbUsername", - description=( - "KrbUsername is the Kerberos username used with Kerberos keytab\nIt must be" " set if keytab is used." - ), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - type: Optional[str] = Field(default=None, title="Type of file operations to watch") - watch_path_config: Optional[WatchPathConfig] = Field(default=None, alias="watchPathConfig") +class ValueFromSource(BaseModel): + config_map_key_ref: Annotated[Optional[v1_1.ConfigMapKeySelector], Field(alias="configMapKeyRef")] = None + secret_key_ref: Annotated[Optional[v1_1.SecretKeySelector], Field(alias="secretKeyRef")] = None -class K8SResourcePolicy(BaseModel): - backoff: Optional[Backoff] = Field(default=None, title="Backoff before checking resource state") - error_on_backoff_timeout: Optional[bool] = Field( - default=None, - alias="errorOnBackoffTimeout", - title=( - "ErrorOnBackoffTimeout determines whether sensor should transition to error" - " state if the trigger policy is unable to determine\nthe state of the" - " resource" - ), - ) - labels: Optional[Dict[str, str]] = Field( - default=None, - title="Labels required to identify whether a resource is in success state", - ) +class Backoff(BaseModel): + duration: Annotated[ + Optional[Int64OrString], + Field(title=('The initial duration in nanoseconds or strings like "1s",' ' "3m"\n+optional')), + ] = None + factor: Annotated[ + Optional[Amount], + Field(title="Duration is multiplied by factor each iteration\n+optional"), + ] = None + jitter: Annotated[ + Optional[Amount], + Field(title="The amount of jitter applied each iteration\n+optional"), + ] = None + steps: Annotated[Optional[int], Field(title="Exit with error after this many steps\n+optional")] = None -class NATSAuth(BaseModel): - basic: Optional[BasicAuth] = Field(default=None, title="Baisc auth with username and password\n+optional") - credential: Optional[v1.SecretKeySelector] = Field(default=None, title="credential used to connect\n+optional") - nkey: Optional[v1.SecretKeySelector] = Field(default=None, title="NKey used to connect\n+optional") - token: Optional[v1.SecretKeySelector] = Field(default=None, title="Token used to connect\n+optional") +class ConditionsResetCriteria(BaseModel): + by_time: Annotated[ + Optional[ConditionsResetByTime], + Field( + alias="byTime", + title=("Schedule is a cron-like expression. For reference, see:" " https://en.wikipedia.org/wiki/Cron"), + ), + ] = None -class PubSubEventSource(BaseModel): - credential_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="credentialSecret", - title=( - "CredentialSecret references to the secret that contains JSON credentials" - " to access GCP.\nIf it is missing, it implicitly uses Workload Identity to" - " access.\nhttps://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity\n+optional" - ), - ) - delete_subscription_on_finish: Optional[bool] = Field( - default=None, - alias="deleteSubscriptionOnFinish", - title=( - "DeleteSubscriptionOnFinish determines whether to delete the GCP PubSub" - " subscription once the event source is stopped.\n+optional" - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - project_id: Optional[str] = Field( - default=None, - alias="projectID", - title=( - "ProjectID is GCP project ID for the subscription.\nRequired if you run" - " Argo Events outside of GKE/GCE.\n(otherwise, the default value is its" - " project)\n+optional" - ), - ) - subscription_id: Optional[str] = Field( - default=None, - alias="subscriptionID", - title=( - "SubscriptionID is ID of subscription.\nRequired if you use existing" - " subscription.\nThe default value will be auto generated hash based on" - " this eventsource setting, so the subscription\nmight be recreated every" - " time you update the setting, which has a possibility of event" - " loss.\n+optional" - ), - ) - topic: Optional[str] = Field( - default=None, - title=( - "Topic to which the subscription should belongs.\nRequired if you want the" - " eventsource to create a new subscription.\nIf you specify this field" - " along with an existing subscription,\nit will be verified whether it" - " actually belongs to the specified topic.\n+optional" - ), - ) - topic_project_id: Optional[str] = Field( - default=None, - alias="topicProjectID", - title=("TopicProjectID is GCP project ID for the topic.\nBy default, it is same as" " ProjectID.\n+optional"), - ) +class EventPersistence(BaseModel): + catchup: Annotated[ + Optional[CatchupConfiguration], + Field(title=("Catchup enables to triggered the missed schedule when eventsource" " restarts")), + ] = None + config_map: Annotated[ + Optional[ConfigMapPersistence], + Field(alias="configMap", title="ConfigMap holds configmap details for persistence"), + ] = None -class ResourceFilter(BaseModel): - after_start: Optional[bool] = Field( - default=None, - alias="afterStart", - title=("If the resource is created after the start time then the event is treated" " as valid.\n+optional"), - ) - created_by: Optional[v1_1.Time] = Field( - default=None, - alias="createdBy", - title=("If resource is created before the specified time then the event is treated" " as valid.\n+optional"), - ) - fields: Optional[List[Selector]] = Field( - default=None, - title=( - "Fields provide field filters similar to K8s field selector\n(see" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/).\nUnlike" - " K8s field selector, it supports arbitrary fileds like" - ' "spec.serviceAccountName",\nand the value could be a string or a' - ' regex.\nSame as K8s field selector, operator "=", "==" and "!=" are' - " supported.\n+optional" - ), - ) - labels: Optional[List[Selector]] = Field( - default=None, - title=( - "Labels provide listing options to K8s API to watch resource/s.\nRefer" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/label-selectors/" - " for more io.argoproj.workflow.v1alpha1.\n+optional" - ), - ) - prefix: Optional[str] = Field(default=None, title="Prefix filter is applied on the resource name.\n+optional") +class FileEventSource(BaseModel): + event_type: Annotated[ + Optional[str], + Field( + alias="eventType", + title=( + "Type of file operations to watch\nRefer" + " https://github.com/fsnotify/fsnotify/blob/master/fsnotify.go for more" + " information" + ), + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + polling: Annotated[Optional[bool], Field(title="Use polling instead of inotify")] = None + watch_path_config: Annotated[ + Optional[WatchPathConfig], + Field( + alias="watchPathConfig", + title="WatchPathConfig contains configuration about the file path to watch", + ), + ] = None + + +class HDFSEventSource(BaseModel): + addresses: Optional[List[str]] = None + check_interval: Annotated[ + Optional[str], + Field( + alias="checkInterval", + title=( + "CheckInterval is a string that describes an interval duration to check" + " the directory state, e.g. 1s, 30m, 2h... (defaults to 1m)" + ), + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + hdfs_user: Annotated[ + Optional[str], + Field( + alias="hdfsUser", + description=( + "HDFSUser is the user to access HDFS file system.\nIt is ignored if" + " either ccache or keytab is used." + ), + ), + ] = None + krb_c_cache_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="krbCCacheSecret", + description=( + "KrbCCacheSecret is the secret selector for Kerberos ccache\nEither" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_config_config_map: Annotated[ + Optional[v1_1.ConfigMapKeySelector], + Field( + alias="krbConfigConfigMap", + description=( + "KrbConfig is the configmap selector for Kerberos config as string\nIt" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_keytab_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="krbKeytabSecret", + description=( + "KrbKeytabSecret is the secret selector for Kerberos keytab\nEither" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_realm: Annotated[ + Optional[str], + Field( + alias="krbRealm", + description=( + "KrbRealm is the Kerberos realm used with Kerberos keytab\nIt must be" " set if keytab is used." + ), + ), + ] = None + krb_service_principal_name: Annotated[ + Optional[str], + Field( + alias="krbServicePrincipalName", + description=( + "KrbServicePrincipalName is the principal name of Kerberos service\nIt" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_username: Annotated[ + Optional[str], + Field( + alias="krbUsername", + description=( + "KrbUsername is the Kerberos username used with Kerberos keytab\nIt" " must be set if keytab is used." + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + type: Annotated[Optional[str], Field(title="Type of file operations to watch")] = None + watch_path_config: Annotated[Optional[WatchPathConfig], Field(alias="watchPathConfig")] = None class S3Artifact(BaseModel): - access_key: Optional[v1.SecretKeySelector] = Field(default=None, alias="accessKey") + access_key: Annotated[Optional[v1_1.SecretKeySelector], Field(alias="accessKey")] = None bucket: Optional[S3Bucket] = None endpoint: Optional[str] = None events: Optional[List[str]] = None @@ -880,1846 +1240,2287 @@ class S3Artifact(BaseModel): insecure: Optional[bool] = None metadata: Optional[Dict[str, str]] = None region: Optional[str] = None - secret_key: Optional[v1.SecretKeySelector] = Field(default=None, alias="secretKey") + secret_key: Annotated[Optional[v1_1.SecretKeySelector], Field(alias="secretKey")] = None -class SASLConfig(BaseModel): - mechanism: Optional[str] = Field( - default=None, - title=( - "SASLMechanism is the name of the enabled SASL mechanism.\nPossible values:" - " OAUTHBEARER, PLAIN (defaults to PLAIN).\n+optional" - ), - ) - password: Optional[v1.SecretKeySelector] = Field(default=None, title="Password for SASL/PLAIN authentication") - user: Optional[v1.SecretKeySelector] = Field( - default=None, - title=( - "User is the authentication identity (authcid) to present for\nSASL/PLAIN" " or SASL/SCRAM authentication" - ), - ) +class TriggerParameter(BaseModel): + dest: Annotated[ + Optional[str], + Field( + description=( + "Dest is the JSONPath of a resource key.\nA path is a series of keys" + " separated by a dot. The colon character can be escaped with '.'\nThe" + " -1 key can be used to append a value to an existing array.\nSee" + " https://github.com/tidwall/sjson#path-syntax for more information" + " about how this is used." + ) + ), + ] = None + operation: Annotated[ + Optional[str], + Field( + description=( + "Operation is what to do with the existing value at Dest, whether" + " to\n'prepend', 'overwrite', or 'append' it." + ) + ), + ] = None + src: Annotated[ + Optional[TriggerParameterSource], + Field(title=("Src contains a source reference to the value of the parameter from a" " dependency")), + ] = None -class SQSEventSource(BaseModel): - access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKey", - title="AccessKey refers K8s secret containing aws access key", - ) - dlq: Optional[bool] = Field( - default=None, - title=( - "DLQ specifies if a dead-letter queue is configured for messages that can't" - " be processed successfully.\nIf set to true, messages with invalid payload" - " won't be acknowledged to allow to forward them farther to the dead-letter" - " queue.\nThe default value is false.\n+optional" - ), - ) - endpoint: Optional[str] = Field( - default=None, - title=("Endpoint configures connection to a specific SQS endpoint instead of" " Amazons servers\n+optional"), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - queue: Optional[str] = Field(default=None, title="Queue is AWS SQS queue to listen to for messages") - queue_account_id: Optional[str] = Field( - default=None, - alias="queueAccountId", - title=("QueueAccountID is the ID of the account that created the queue to" " monitor\n+optional"), - ) - region: Optional[str] = Field(default=None, title="Region is AWS region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), - ) - secret_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKey", - title="SecretKey refers K8s secret containing aws secret key", - ) - session_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sessionToken", - title=( - "SessionToken refers to K8s secret containing AWS temporary" " credentials(STS) session token\n+optional" - ), - ) - wait_time_seconds: Optional[str] = Field( - default=None, - alias="waitTimeSeconds", - description=( - "WaitTimeSeconds is The duration (in seconds) for which the call waits for" - " a message to arrive\nin the queue before returning." - ), - ) +class ResourceEventSource(BaseModel): + event_types: Annotated[ + Optional[List[str]], + Field( + alias="eventTypes", + description=( + "EventTypes is the list of event type to watch.\nPossible values are -" " ADD, UPDATE and DELETE." + ), + ), + ] = None + filter: Annotated[ + Optional[ResourceFilter], + Field( + title=( + "Filter is applied on the metadata of the resource\nIf you apply" + " filter, then the internal event informer will only monitor objects" + " that pass the filter.\n+optional" + ) + ), + ] = None + group_version_resource: Annotated[ + Optional[v1.GroupVersionResource], + Field(alias="groupVersionResource", title="Group of the resource"), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + namespace: Annotated[Optional[str], Field(title="Namespace where resource is deployed")] = None -class Status(BaseModel): - conditions: Optional[List[Condition]] = Field( - default=None, - title=( - "Conditions are the latest available observations of a resource's current" - " state.\n+optional\n+patchMergeKey=type\n+patchStrategy=merge" - ), - ) +class NATSAuth(BaseModel): + basic: Annotated[ + Optional[BasicAuth], + Field(title="Baisc auth with username and password\n+optional"), + ] = None + credential: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="credential used to connect\n+optional"), + ] = None + nkey: Annotated[Optional[v1_1.SecretKeySelector], Field(title="NKey used to connect\n+optional")] = None + token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Token used to connect\n+optional"), + ] = None -class TLSConfig(BaseModel): - ca_cert_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="caCertSecret", - title="CACertSecret refers to the secret that contains the CA cert", - ) - client_cert_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="clientCertSecret", - title="ClientCertSecret refers to the secret that contains the client cert", - ) - client_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="clientKeySecret", - title="ClientKeySecret refers to the secret that contains the client key", - ) - insecure_skip_verify: Optional[bool] = Field( - default=None, - alias="insecureSkipVerify", - title=( - "If true, skips creation of TLSConfig with certs and creates an empty" - " TLSConfig. (Defaults to false)\n+optional" - ), - ) +class BitbucketAuth(BaseModel): + basic: Annotated[ + Optional[BitbucketBasicAuth], + Field(title="Basic is BasicAuth auth strategy.\n+optional"), + ] = None + oauth_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="oauthToken", + title=("OAuthToken refers to the K8s secret that holds the OAuth Bearer" " token.\n+optional"), + ), + ] = None -class TriggerParameter(BaseModel): - dest: Optional[str] = Field( - default=None, - description=( - "Dest is the JSONPath of a resource key.\nA path is a series of keys" - " separated by a dot. The colon character can be escaped with '.'\nThe -1" - " key can be used to append a value to an existing array.\nSee" - " https://github.com/tidwall/sjson#path-syntax for more information about" - " how this is used." - ), - ) - operation: Optional[str] = Field( - default=None, - description=( - "Operation is what to do with the existing value at Dest, whether" - " to\n'prepend', 'overwrite', or 'append' it." - ), - ) - src: Optional[TriggerParameterSource] = Field( - default=None, - title=("Src contains a source reference to the value of the parameter from a" " dependency"), - ) +class GitArtifact(BaseModel): + branch: Annotated[Optional[str], Field(title="Branch to use to pull trigger resource\n+optional")] = None + clone_directory: Annotated[ + Optional[str], + Field( + alias="cloneDirectory", + description=( + "Directory to clone the repository. We clone complete directory because" + " GitArtifact is not limited to any specific Git service" + " providers.\nHence we don't use any specific git provider client." + ), + ), + ] = None + creds: Annotated[ + Optional[GitCreds], + Field(title="Creds contain reference to git username and password\n+optional"), + ] = None + file_path: Annotated[ + Optional[str], + Field( + alias="filePath", + title="Path to file that contains trigger resource definition", + ), + ] = None + insecure_ignore_host_key: Annotated[ + Optional[bool], + Field(alias="insecureIgnoreHostKey", title="Whether to ignore host key\n+optional"), + ] = None + ref: Annotated[ + Optional[str], + Field(title=("Ref to use to pull trigger resource. Will result in a shallow clone" " and\nfetch.\n+optional")), + ] = None + remote: Annotated[ + Optional[GitRemoteConfig], + Field( + title=( + "Remote to manage set of tracked repositories. Defaults to" + ' "origin".\nRefer https://git-scm.com/docs/git-remote\n+optional' + ) + ), + ] = None + ssh_key_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sshKeySecret", + title="SSHKeySecret refers to the secret that contains SSH key", + ), + ] = None + tag: Annotated[Optional[str], Field(title="Tag to use to pull trigger resource\n+optional")] = None + url: Annotated[Optional[str], Field(title="Git URL")] = None -class TriggerPolicy(BaseModel): - k8s: Optional[K8SResourcePolicy] = Field( - default=None, - title=( - "K8SResourcePolicy refers to the policy used to check the state of K8s" - " based triggers using using labels" - ), - ) - status: Optional[StatusPolicy] = Field( - default=None, - title=("Status refers to the policy used to check the state of the trigger using" " response status"), - ) +class KafkaTrigger(BaseModel): + compress: Annotated[ + Optional[bool], + Field( + title=( + "Compress determines whether to compress message or not.\nDefaults to" + " false.\nIf set to true, compresses message using snappy" + " compression.\n+optional" + ) + ), + ] = None + flush_frequency: Annotated[ + Optional[int], + Field( + alias="flushFrequency", + title=( + "FlushFrequency refers to the frequency in milliseconds to flush" + " batches.\nDefaults to 500 milliseconds.\n+optional" + ), + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=("Parameters is the list of parameters that is applied to resolved Kafka" " trigger object.") + ), + ] = None + partition: Annotated[Optional[int], Field(description="Partition to write data to.")] = None + partitioning_key: Annotated[ + Optional[str], + Field( + alias="partitioningKey", + description=( + "The partitioning key for the messages put on the Kafka" " topic.\nDefaults to broker url.\n+optional." + ), + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + required_acks: Annotated[ + Optional[int], + Field( + alias="requiredAcks", + description=( + "RequiredAcks used in producer to tell the broker how many replica" + " acknowledgements\nDefaults to 1 (Only wait for the leader to" + " ack).\n+optional." + ), + ), + ] = None + sasl: Annotated[ + Optional[SASLConfig], + Field(title="SASL configuration for the kafka client\n+optional"), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the Kafka producer.\n+optional"), + ] = None + topic: Annotated[ + Optional[str], + Field(title=("Name of the topic.\nMore info at" " https://kafka.apache.org/documentation/#intro_topics")), + ] = None + url: Annotated[ + Optional[str], + Field(description="URL of the Kafka broker, multiple URLs separated by comma."), + ] = None + version: Annotated[ + Optional[str], + Field( + title=( + "Specify what kafka version is being connected to enables certain" + " features in sarama, defaults to 1.0.0\n+optional" + ) + ), + ] = None -class ValueFromSource(BaseModel): - config_map_key_ref: Optional[v1.ConfigMapKeySelector] = Field(default=None, alias="configMapKeyRef") - secret_key_ref: Optional[v1.SecretKeySelector] = Field(default=None, alias="secretKeyRef") +class NATSTrigger(BaseModel): + parameters: Optional[List[TriggerParameter]] = None + payload: Optional[List[TriggerParameter]] = None + subject: Annotated[Optional[str], Field(description="Name of the subject to put message on.")] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the NATS producer.\n+optional"), + ] = None + url: Annotated[Optional[str], Field(description="URL of the NATS cluster.")] = None -class WebhookContext(BaseModel): - auth_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authSecret", - title=("AuthSecret holds a secret selector that contains a bearer token for" " authentication\n+optional"), - ) - endpoint: Optional[str] = Field(default=None, title="REST API endpoint") - max_payload_size: Optional[str] = Field( - default=None, - alias="maxPayloadSize", - title=( - "MaxPayloadSize is the maximum webhook payload size that the server will" - ' accept.\nRequests exceeding that limit will be rejected with "request too' - ' large" response.\nDefault value: 1048576 (1MB).\n+optional' - ), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - method: Optional[str] = Field( - default=None, - title=( - "Method is HTTP request method that indicates the desired action to be" - " performed for a given resource.\nSee RFC7231 Hypertext Transfer Protocol" - " (HTTP/1.1): Semantics and Content" - ), - ) - port: Optional[str] = Field( - default=None, - description="Port on which HTTP server is listening for incoming events.", - ) - server_cert_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serverCertSecret", - description="ServerCertPath refers the file that contains the cert.", - ) - server_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serverKeySecret", - title="ServerKeyPath refers the file that contains private key", - ) - url: Optional[str] = Field(default=None, description="URL is the url of the server.") +class RedisEventSource(BaseModel): + channels: Optional[List[str]] = None + db: Annotated[ + Optional[int], + Field(title="DB to use. If not specified, default DB 0 will be used.\n+optional"), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + host_address: Annotated[ + Optional[str], + Field( + alias="hostAddress", + title="HostAddress refers to the address of the Redis host/server", + ), + ] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + namespace: Annotated[ + Optional[str], + Field( + title=( + "Namespace to use to retrieve the password from. It should only be" + " specified if password is declared\n+optional" + ) + ), + ] = None + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Password required for authentication if any.\n+optional"), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the redis client.\n+optional"), + ] = None + username: Annotated[ + Optional[str], + Field(title="Username required for ACL style authentication if any.\n+optional"), + ] = None -class WebhookEventSource(BaseModel): - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - webhook_context: Optional[WebhookContext] = Field(default=None, alias="webhookContext") +class RedisStreamEventSource(BaseModel): + consumer_group: Annotated[ + Optional[str], + Field( + alias="consumerGroup", + title=( + "ConsumerGroup refers to the Redis stream consumer group that will" + " be\ncreated on all redis streams. Messages are read through this" + " group. Defaults to 'argo-events-cg'\n+optional" + ), + ), + ] = None + db: Annotated[ + Optional[int], + Field(title="DB to use. If not specified, default DB 0 will be used.\n+optional"), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + host_address: Annotated[ + Optional[str], + Field( + alias="hostAddress", + title=("HostAddress refers to the address of the Redis host/server (master" " instance)"), + ), + ] = None + max_msg_count_per_read: Annotated[ + Optional[int], + Field( + alias="maxMsgCountPerRead", + title=( + "MaxMsgCountPerRead holds the maximum number of messages per stream" + " that will be read in each XREADGROUP of all streams\nExample: if" + " there are 2 streams and MaxMsgCountPerRead=10, then each XREADGROUP" + " may read upto a total of 20 messages.\nSame as COUNT option in" + " XREADGROUP(https://redis.io/topics/streams-intro). Defaults to" + " 10\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Password required for authentication if any.\n+optional"), + ] = None + streams: Annotated[ + Optional[List[str]], + Field( + description=( + "Streams to look for entries. XREADGROUP is used on all streams using a" " single consumer group." + ) + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the redis client.\n+optional"), + ] = None + username: Annotated[ + Optional[str], + Field(title="Username required for ACL style authentication if any.\n+optional"), + ] = None -class AMQPEventSource(BaseModel): - auth: Optional[BasicAuth] = Field( - default=None, - title="Auth hosts secret selectors for username and password\n+optional", - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - consume: Optional[AMQPConsumeConfig] = Field( - default=None, - title=( - "Consume holds the configuration to immediately starts delivering queued" - " messages\nFor more information, visit" - " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.Consume\n+optional" - ), - ) - exchange_declare: Optional[AMQPExchangeDeclareConfig] = Field( - default=None, - alias="exchangeDeclare", - title=( - "ExchangeDeclare holds the configuration for the exchange on the" - " server\nFor more information, visit" - " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.ExchangeDeclare\n+optional" - ), - ) - exchange_name: Optional[str] = Field( - default=None, - alias="exchangeName", - title=( - "ExchangeName is the exchange name\nFor more information, visit" - " https://www.rabbitmq.com/tutorials/amqp-concepts.html" - ), - ) - exchange_type: Optional[str] = Field( - default=None, - alias="exchangeType", - title="ExchangeType is rabbitmq exchange type", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - queue_bind: Optional[AMQPQueueBindConfig] = Field( - default=None, - alias="queueBind", - title=( - "QueueBind holds the configuration that binds an exchange to a queue so" - " that publishings to the\nexchange will be routed to the queue when the" - " publishing routing key matches the binding routing key\nFor more" - " information, visit" - " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueBind\n+optional" - ), - ) - queue_declare: Optional[AMQPQueueDeclareConfig] = Field( - default=None, - alias="queueDeclare", - title=( - "QueueDeclare holds the configuration of a queue to hold messages and" - " deliver to consumers.\nDeclaring creates a queue if it doesn't already" - " exist, or ensures that an existing queue matches\nthe same" - " parameters\nFor more information, visit" - " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueDeclare\n+optional" - ), - ) - routing_key: Optional[str] = Field(default=None, alias="routingKey", title="Routing key for bindings") - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the amqp client.\n+optional") - url: Optional[str] = Field(default=None, title="URL for rabbitmq service") - url_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="urlSecret", - title="URLSecret is secret reference for rabbitmq service URL", - ) +class BitbucketServerEventSource(BaseModel): + access_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessToken", + title=("AccessToken is reference to K8s secret which holds the bitbucket api" " access information"), + ), + ] = None + bitbucketserver_base_url: Annotated[ + Optional[str], + Field( + alias="bitbucketserverBaseURL", + title=("BitbucketServerBaseURL is the base URL for API requests to a custom" " endpoint"), + ), + ] = None + delete_hook_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteHookOnFinish", + title=( + "DeleteHookOnFinish determines whether to delete the Bitbucket Server" + " hook for the project once the event source is stopped.\n+optional" + ), + ), + ] = None + events: Annotated[ + Optional[List[str]], + Field( + title=( + "Events are bitbucket event to listen to.\nRefer" + " https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html" + ) + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + project_key: Annotated[ + Optional[str], + Field( + alias="projectKey", + title=( + "DeprecatedProjectKey is the key of project for which integration needs" + " to set up\nDeprecated: use Repositories instead. Will be unsupported" + " in v1.8\n+optional" + ), + ), + ] = None + repositories: Annotated[ + Optional[List[BitbucketServerRepository]], + Field(title=("Repositories holds a list of repositories for which integration needs" " to set up\n+optional")), + ] = None + repository_slug: Annotated[ + Optional[str], + Field( + alias="repositorySlug", + title=( + "DeprecatedRepositorySlug is the slug of the repository for which" + " integration needs to set up\nDeprecated: use Repositories instead." + " Will be unsupported in v1.8\n+optional" + ), + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration to run a http server"), + ] = None + webhook_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="webhookSecret", + title=( + "WebhookSecret is reference to K8s secret which holds the bitbucket" + " webhook secret (for HMAC validation)" + ), + ), + ] = None -class AWSLambdaTrigger(BaseModel): - access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKey", - title="AccessKey refers K8s secret containing aws access key\n+optional", - ) - function_name: Optional[str] = Field( - default=None, - alias="functionName", - description="FunctionName refers to the name of the function to invoke.", - ) - invocation_type: Optional[str] = Field( - default=None, - alias="invocationType", - description=( - "Choose from the following options.\n\n * RequestResponse (default) -" - " Invoke the function synchronously. Keep\n the connection open until the" - " function returns a response or times out.\n The API response includes" - " the function response and additional data.\n\n * Event - Invoke the" - " function asynchronously. Send events that fail multiple\n times to the" - " function's dead-letter queue (if it's configured). The API\n response" - " only includes a status code.\n\n * DryRun - Validate parameter values" - " and verify that the user or role\n has permission to invoke the" - " function.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe trigger resource.\n+optional" - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - region: Optional[str] = Field(default=None, title="Region is AWS region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), - ) - secret_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKey", - title="SecretKey refers K8s secret containing aws secret key\n+optional", - ) +class GithubEventSource(BaseModel): + active: Annotated[ + Optional[bool], + Field( + title=( + "Active refers to status of the webhook for event" + " deliveries.\nhttps://developer.github.com/webhooks/creating/#active\n+optional" + ) + ), + ] = None + api_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="apiToken", + title=("APIToken refers to a K8s secret containing github api token\n+optional"), + ), + ] = None + content_type: Annotated[ + Optional[str], + Field(alias="contentType", title="ContentType of the event delivery"), + ] = None + delete_hook_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteHookOnFinish", + title=( + "DeleteHookOnFinish determines whether to delete the GitHub hook for" + " the repository once the event source is stopped.\n+optional" + ), + ), + ] = None + events: Annotated[ + Optional[List[str]], + Field(title=("Events refer to Github events to which the event source will subscribe")), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + github_app: Annotated[ + Optional[GithubAppCreds], + Field( + alias="githubApp", + title="GitHubApp holds the GitHub app credentials\n+optional", + ), + ] = None + github_base_url: Annotated[ + Optional[str], + Field( + alias="githubBaseURL", + title="GitHub base URL (for GitHub Enterprise)\n+optional", + ), + ] = None + github_upload_url: Annotated[ + Optional[str], + Field( + alias="githubUploadURL", + title="GitHub upload URL (for GitHub Enterprise)\n+optional", + ), + ] = None + id: Annotated[ + Optional[str], + Field( + title=( + "Id is the webhook's id\nDeprecated: This is not used at all, will be" " removed in v1.6\n+optional" + ) + ), + ] = None + insecure: Annotated[Optional[bool], Field(title="Insecure tls verification")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + organizations: Annotated[ + Optional[List[str]], + Field( + description=( + "Organizations holds the names of organizations (used for organization" + " level webhooks). Not required if Repositories is set." + ) + ), + ] = None + owner: Annotated[ + Optional[str], + Field( + title=( + "DeprecatedOwner refers to GitHub owner name i.e. argoproj\nDeprecated:" + " use Repositories instead. Will be unsupported in v 1.6\n+optional" + ) + ), + ] = None + repositories: Annotated[ + Optional[List[OwnedRepositories]], + Field( + description=( + "Repositories holds the information of repositories, which uses repo" + " owner as the key,\nand list of repo names as the value. Not required" + " if Organizations is set." + ) + ), + ] = None + repository: Annotated[ + Optional[str], + Field( + title=( + "DeprecatedRepository refers to GitHub repo name i.e." + " argo-events\nDeprecated: use Repositories instead. Will be" + " unsupported in v 1.6\n+optional" + ) + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook refers to the configuration required to run a http server"), + ] = None + webhook_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="webhookSecret", + title=( + "WebhookSecret refers to K8s secret containing GitHub webhook" + " secret\nhttps://developer.github.com/webhooks/securing/\n+optional" + ), + ), + ] = None -class AzureEventHubsTrigger(BaseModel): - fqdn: Optional[str] = Field( - default=None, - title=( - "FQDN refers to the namespace dns of Azure Event Hubs to be used i.e." - " .servicebus.windows.net" - ), - ) - hub_name: Optional[str] = Field( - default=None, - alias="hubName", - title="HubName refers to the Azure Event Hub to send events to", - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe trigger resource.\n+optional" - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - shared_access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sharedAccessKey", - title=("SharedAccessKey refers to a K8s secret containing the primary key for the"), - ) - shared_access_key_name: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sharedAccessKeyName", - title="SharedAccessKeyName refers to the name of the Shared Access Key", - ) +class GitlabEventSource(BaseModel): + access_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessToken", + title=("AccessToken references to k8 secret which holds the gitlab api access" " information"), + ), + ] = None + delete_hook_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteHookOnFinish", + title=( + "DeleteHookOnFinish determines whether to delete the GitLab hook for" + " the project once the event source is stopped.\n+optional" + ), + ), + ] = None + enable_ssl_verification: Annotated[ + Optional[bool], + Field( + alias="enableSSLVerification", + title="EnableSSLVerification to enable ssl verification\n+optional", + ), + ] = None + events: Annotated[ + Optional[List[str]], + Field( + description=( + "Events are gitlab event to listen to.\nRefer" + " https://github.com/xanzy/go-gitlab/blob/bf34eca5d13a9f4c3f501d8a97b8ac226d55e4d9/projects.go#L794." + ) + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + gitlab_base_url: Annotated[ + Optional[str], + Field( + alias="gitlabBaseURL", + title="GitlabBaseURL is the base URL for API requests to a custom endpoint", + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + project_id: Annotated[ + Optional[str], + Field( + alias="projectID", + title=( + "DeprecatedProjectID is the id of project for which integration needs" + " to setup\nDeprecated: use Projects instead. Will be unsupported in v" + " 1.7\n+optional" + ), + ), + ] = None + projects: Annotated[ + Optional[List[str]], + Field(title='List of project IDs or project namespace paths like "whynowy/test"'), + ] = None + secret_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="secretToken", + title=("SecretToken references to k8 secret which holds the Secret Token used" " by webhook config"), + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration to run a http server"), + ] = None -class BitbucketAuth(BaseModel): - basic: Optional[BitbucketBasicAuth] = Field(default=None, title="Basic is BasicAuth auth strategy.\n+optional") - oauth_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="oauthToken", - title=("OAuthToken refers to the K8s secret that holds the OAuth Bearer" " token.\n+optional"), - ) +class SNSEventSource(BaseModel): + access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessKey", + title="AccessKey refers K8s secret containing aws access key", + ), + ] = None + endpoint: Annotated[ + Optional[str], + Field( + title=( + "Endpoint configures connection to a specific SNS endpoint instead of" " Amazons servers\n+optional" + ) + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + region: Annotated[Optional[str], Field(title="Region is AWS region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), + ), + ] = None + secret_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="secretKey", + title="SecretKey refers K8s secret containing aws secret key", + ), + ] = None + topic_arn: Annotated[Optional[str], Field(alias="topicArn", title="TopicArn")] = None + validate_signature: Annotated[ + Optional[bool], + Field( + alias="validateSignature", + title=( + "ValidateSignature is boolean that can be set to true for SNS signature" " verification\n+optional" + ), + ), + ] = None + webhook: Annotated[Optional[WebhookContext], Field(title="Webhook configuration for http server")] = None -class BitbucketEventSource(BaseModel): - auth: Optional[BitbucketAuth] = Field( - default=None, description="Auth information required to connect to Bitbucket." - ) - delete_hook_on_finish: Optional[bool] = Field( - default=None, - alias="deleteHookOnFinish", - title=( - "DeleteHookOnFinish determines whether to delete the defined Bitbucket hook" - " once the event source is stopped.\n+optional" - ), - ) - events: Optional[List[str]] = Field(default=None, description="Events this webhook is subscribed to.") - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will be passed along the" " event payload.\n+optional"), - ) - owner: Optional[str] = Field( - default=None, - title=( - "DeprecatedOwner is the owner of the repository.\nDeprecated: use" - " Repositories instead. Will be unsupported in v1.9\n+optional" - ), - ) - project_key: Optional[str] = Field( - default=None, - alias="projectKey", - title=( - "DeprecatedProjectKey is the key of the project to which the repository" - " relates\nDeprecated: use Repositories instead. Will be unsupported in" - " v1.9\n+optional" - ), - ) - repositories: Optional[List[BitbucketRepository]] = Field( - default=None, - title=("Repositories holds a list of repositories for which integration needs to" " set up\n+optional"), - ) - repository_slug: Optional[str] = Field( - default=None, - alias="repositorySlug", - title=( - "DeprecatedRepositorySlug is a URL-friendly version of a repository name," - " automatically generated by Bitbucket for use in the URL\nDeprecated: use" - " Repositories instead. Will be unsupported in v1.9\n+optional" - ), - ) - webhook: Optional[WebhookContext] = Field( - default=None, - title="Webhook refers to the configuration required to run an http server", - ) +class SlackEventSource(BaseModel): + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + signing_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(alias="signingSecret", title="Slack App signing secret"), + ] = None + token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Token for URL verification handshake"), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration for a REST endpoint"), + ] = None -class BitbucketServerEventSource(BaseModel): - access_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessToken", - title=("AccessToken is reference to K8s secret which holds the bitbucket api" " access information"), - ) - bitbucketserver_base_url: Optional[str] = Field( - default=None, - alias="bitbucketserverBaseURL", - title=("BitbucketServerBaseURL is the base URL for API requests to a custom" " endpoint"), - ) - delete_hook_on_finish: Optional[bool] = Field( - default=None, - alias="deleteHookOnFinish", - title=( - "DeleteHookOnFinish determines whether to delete the Bitbucket Server hook" - " for the project once the event source is stopped.\n+optional" - ), - ) - events: Optional[List[str]] = Field( - default=None, - title=( - "Events are bitbucket event to listen to.\nRefer" - " https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html" - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - project_key: Optional[str] = Field( - default=None, - alias="projectKey", - title=( - "DeprecatedProjectKey is the key of project for which integration needs to" - " set up\nDeprecated: use Repositories instead. Will be unsupported in" - " v1.8\n+optional" - ), - ) - repositories: Optional[List[BitbucketServerRepository]] = Field( - default=None, - title=("Repositories holds a list of repositories for which integration needs to" " set up\n+optional"), - ) - repository_slug: Optional[str] = Field( - default=None, - alias="repositorySlug", - title=( - "DeprecatedRepositorySlug is the slug of the repository for which" - " integration needs to set up\nDeprecated: use Repositories instead. Will" - " be unsupported in v1.8\n+optional" - ), - ) - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration to run a http server") - webhook_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="webhookSecret", - title=( - "WebhookSecret is reference to K8s secret which holds the bitbucket webhook" - " secret (for HMAC validation)" - ), - ) +class StorageGridEventSource(BaseModel): + api_url: Annotated[ + Optional[str], + Field(alias="apiURL", description="APIURL is the url of the storagegrid api."), + ] = None + auth_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(alias="authToken", title="Auth token for storagegrid api"), + ] = None + bucket: Annotated[ + Optional[str], + Field(description="Name of the bucket to register notifications for."), + ] = None + events: Optional[List[str]] = None + filter: Annotated[ + Optional[StorageGridFilter], + Field(description="Filter on object key which caused the notification."), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + region: Annotated[Optional[str], Field(title="S3 region.\nDefaults to us-east-1\n+optional")] = None + topic_arn: Annotated[Optional[str], Field(alias="topicArn", title="TopicArn")] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration for a REST endpoint"), + ] = None -class CustomTrigger(BaseModel): - cert_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="certSecret", - description=( - "CertSecret refers to the secret that contains cert for secure connection" - " between sensor and custom trigger gRPC server." - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Parameters is the list of parameters that is applied to resolved custom" " trigger trigger object." - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - secure: Optional[bool] = Field( - default=None, - title=("Secure refers to type of the connection between sensor to custom trigger" " gRPC"), - ) - server_name_override: Optional[str] = Field( - default=None, - alias="serverNameOverride", - description=("ServerNameOverride for the secure connection between sensor and custom" " trigger gRPC server."), - ) - server_url: Optional[str] = Field( - default=None, - alias="serverURL", - title="ServerURL is the url of the gRPC server that executes custom trigger", - ) - spec: Optional[Dict[str, str]] = Field( - default=None, - description=( - "Spec is the custom trigger resource specification that custom trigger gRPC" - " server knows how to interpret." - ), - ) +class StripeEventSource(BaseModel): + api_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="apiKey", + title=( + "APIKey refers to K8s secret that holds Stripe API key. Used only if" + " CreateWebhook is enabled.\n+optional" + ), + ), + ] = None + create_webhook: Annotated[ + Optional[bool], + Field( + alias="createWebhook", + title=("CreateWebhook if specified creates a new webhook" " programmatically.\n+optional"), + ), + ] = None + event_filter: Annotated[ + Optional[List[str]], + Field( + alias="eventFilter", + title=( + "EventFilter describes the type of events to listen to. If not" + " specified, all types of events will be processed.\nMore info at" + " https://stripe.com/docs/api/events/list\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook holds configuration for a REST endpoint"), + ] = None -class EmitterEventSource(BaseModel): - broker: Optional[str] = Field(default=None, description="Broker URI to connect to.") - channel_key: Optional[str] = Field(default=None, alias="channelKey", title="ChannelKey refers to the channel key") - channel_name: Optional[str] = Field( - default=None, - alias="channelName", - title="ChannelName refers to the channel name", - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - password: Optional[v1.SecretKeySelector] = Field( - default=None, title="Password to use to connect to broker\n+optional" - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the emitter client.\n+optional") - username: Optional[v1.SecretKeySelector] = Field( - default=None, title="Username to use to connect to broker\n+optional" - ) +class WebhookEventSource(BaseModel): + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + webhook_context: Annotated[Optional[WebhookContext], Field(alias="webhookContext")] = None -class EventDependencyFilter(BaseModel): - context: Optional[EventContext] = Field(default=None, title="Context filter constraints") - data: Optional[List[DataFilter]] = Field(default=None, title="Data filter constraints with escalation") - data_logical_operator: Optional[str] = Field( - default=None, - alias="dataLogicalOperator", - description=( - "DataLogicalOperator defines how multiple Data filters (if defined) are" - " evaluated together.\nAvailable values: and (&&), or (||)\nIs optional and" - " if left blank treated as and (&&)." - ), - ) - expr_logical_operator: Optional[str] = Field( - default=None, - alias="exprLogicalOperator", - description=( - "ExprLogicalOperator defines how multiple Exprs filters (if defined) are" - " evaluated together.\nAvailable values: and (&&), or (||)\nIs optional and" - " if left blank treated as and (&&)." - ), - ) - exprs: Optional[List[ExprFilter]] = Field( - default=None, - description=("Exprs contains the list of expressions evaluated against the event" " payload."), - ) - script: Optional[str] = Field( - default=None, - description=( - "Script refers to a Lua script evaluated to determine the validity of an" " io.argoproj.workflow.v1alpha1." - ), - ) - time: Optional[TimeFilter] = Field(default=None, title="Time filter on the event with escalation") +class SecureHeader(BaseModel): + name: Optional[str] = None + value_from: Annotated[ + Optional[ValueFromSource], + Field( + alias="valueFrom", + title="Values can be read from either secrets or configmaps", + ), + ] = None -class EventSourceStatus(BaseModel): - status: Optional[Status] = None +class AMQPEventSource(BaseModel): + auth: Annotated[ + Optional[BasicAuth], + Field(title="Auth hosts secret selectors for username and password\n+optional"), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + consume: Annotated[ + Optional[AMQPConsumeConfig], + Field( + title=( + "Consume holds the configuration to immediately starts delivering" + " queued messages\nFor more information, visit" + " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.Consume\n+optional" + ) + ), + ] = None + exchange_declare: Annotated[ + Optional[AMQPExchangeDeclareConfig], + Field( + alias="exchangeDeclare", + title=( + "ExchangeDeclare holds the configuration for the exchange on the" + " server\nFor more information, visit" + " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.ExchangeDeclare\n+optional" + ), + ), + ] = None + exchange_name: Annotated[ + Optional[str], + Field( + alias="exchangeName", + title=( + "ExchangeName is the exchange name\nFor more information, visit" + " https://www.rabbitmq.com/tutorials/amqp-concepts.html" + ), + ), + ] = None + exchange_type: Annotated[ + Optional[str], + Field(alias="exchangeType", title="ExchangeType is rabbitmq exchange type"), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + queue_bind: Annotated[ + Optional[AMQPQueueBindConfig], + Field( + alias="queueBind", + title=( + "QueueBind holds the configuration that binds an exchange to a queue so" + " that publishings to the\nexchange will be routed to the queue when" + " the publishing routing key matches the binding routing key\nFor more" + " information, visit" + " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueBind\n+optional" + ), + ), + ] = None + queue_declare: Annotated[ + Optional[AMQPQueueDeclareConfig], + Field( + alias="queueDeclare", + title=( + "QueueDeclare holds the configuration of a queue to hold messages and" + " deliver to consumers.\nDeclaring creates a queue if it doesn't" + " already exist, or ensures that an existing queue matches\nthe same" + " parameters\nFor more information, visit" + " https://pkg.go.dev/github.com/rabbitmq/amqp091-go#Channel.QueueDeclare\n+optional" + ), + ), + ] = None + routing_key: Annotated[Optional[str], Field(alias="routingKey", title="Routing key for bindings")] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the amqp client.\n+optional"), + ] = None + url: Annotated[Optional[str], Field(title="URL for rabbitmq service")] = None + url_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="urlSecret", + title="URLSecret is secret reference for rabbitmq service URL", + ), + ] = None -class GitArtifact(BaseModel): - branch: Optional[str] = Field(default=None, title="Branch to use to pull trigger resource\n+optional") - clone_directory: Optional[str] = Field( - default=None, - alias="cloneDirectory", - description=( - "Directory to clone the repository. We clone complete directory because" - " GitArtifact is not limited to any specific Git service providers.\nHence" - " we don't use any specific git provider client." - ), - ) - creds: Optional[GitCreds] = Field( - default=None, - title="Creds contain reference to git username and password\n+optional", - ) - file_path: Optional[str] = Field( - default=None, - alias="filePath", - title="Path to file that contains trigger resource definition", - ) - insecure_ignore_host_key: Optional[bool] = Field( - default=None, - alias="insecureIgnoreHostKey", - title="Whether to ignore host key\n+optional", - ) - ref: Optional[str] = Field( - default=None, - title=("Ref to use to pull trigger resource. Will result in a shallow clone" " and\nfetch.\n+optional"), - ) - remote: Optional[GitRemoteConfig] = Field( - default=None, - title=( - 'Remote to manage set of tracked repositories. Defaults to "origin".\nRefer' - " https://git-scm.com/docs/git-remote\n+optional" - ), - ) - ssh_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sshKeySecret", - title="SSHKeySecret refers to the secret that contains SSH key", - ) - tag: Optional[str] = Field(default=None, title="Tag to use to pull trigger resource\n+optional") - url: Optional[str] = Field(default=None, title="Git URL") +class EmitterEventSource(BaseModel): + broker: Annotated[Optional[str], Field(description="Broker URI to connect to.")] = None + channel_key: Annotated[ + Optional[str], + Field(alias="channelKey", title="ChannelKey refers to the channel key"), + ] = None + channel_name: Annotated[ + Optional[str], + Field(alias="channelName", title="ChannelName refers to the channel name"), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + password: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Password to use to connect to broker\n+optional"), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the emitter client.\n+optional"), + ] = None + username: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(title="Username to use to connect to broker\n+optional"), + ] = None -class GithubEventSource(BaseModel): - active: Optional[bool] = Field( - default=None, - title=( - "Active refers to status of the webhook for event" - " deliveries.\nhttps://developer.github.com/webhooks/creating/#active\n+optional" - ), - ) - api_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="apiToken", - title="APIToken refers to a K8s secret containing github api token\n+optional", - ) - content_type: Optional[str] = Field(default=None, alias="contentType", title="ContentType of the event delivery") - delete_hook_on_finish: Optional[bool] = Field( - default=None, - alias="deleteHookOnFinish", - title=( - "DeleteHookOnFinish determines whether to delete the GitHub hook for the" - " repository once the event source is stopped.\n+optional" - ), - ) - events: Optional[List[str]] = Field( - default=None, - title="Events refer to Github events to which the event source will subscribe", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - github_app: Optional[GithubAppCreds] = Field( - default=None, - alias="githubApp", - title="GitHubApp holds the GitHub app credentials\n+optional", - ) - github_base_url: Optional[str] = Field( - default=None, - alias="githubBaseURL", - title="GitHub base URL (for GitHub Enterprise)\n+optional", - ) - github_upload_url: Optional[str] = Field( - default=None, - alias="githubUploadURL", - title="GitHub upload URL (for GitHub Enterprise)\n+optional", - ) - id: Optional[str] = Field( - default=None, - title=("Id is the webhook's id\nDeprecated: This is not used at all, will be" " removed in v1.6\n+optional"), - ) - insecure: Optional[bool] = Field(default=None, title="Insecure tls verification") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - organizations: Optional[List[str]] = Field( - default=None, - description=( - "Organizations holds the names of organizations (used for organization" - " level webhooks). Not required if Repositories is set." - ), - ) - owner: Optional[str] = Field( - default=None, - title=( - "DeprecatedOwner refers to GitHub owner name i.e. argoproj\nDeprecated: use" - " Repositories instead. Will be unsupported in v 1.6\n+optional" - ), - ) - repositories: Optional[List[OwnedRepositories]] = Field( - default=None, - description=( - "Repositories holds the information of repositories, which uses repo owner" - " as the key,\nand list of repo names as the value. Not required if" - " Organizations is set." - ), - ) - repository: Optional[str] = Field( - default=None, - title=( - "DeprecatedRepository refers to GitHub repo name i.e." - " argo-events\nDeprecated: use Repositories instead. Will be unsupported in" - " v 1.6\n+optional" - ), - ) - webhook: Optional[WebhookContext] = Field( - default=None, - title="Webhook refers to the configuration required to run a http server", - ) - webhook_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="webhookSecret", - title=( - "WebhookSecret refers to K8s secret containing GitHub webhook" - " secret\nhttps://developer.github.com/webhooks/securing/\n+optional" - ), - ) +class K8SResourcePolicy(BaseModel): + backoff: Annotated[Optional[Backoff], Field(title="Backoff before checking resource state")] = None + error_on_backoff_timeout: Annotated[ + Optional[bool], + Field( + alias="errorOnBackoffTimeout", + title=( + "ErrorOnBackoffTimeout determines whether sensor should transition to" + " error state if the trigger policy is unable to determine\nthe state" + " of the resource" + ), + ), + ] = None + labels: Annotated[ + Optional[Dict[str, str]], + Field(title="Labels required to identify whether a resource is in success state"), + ] = None -class GitlabEventSource(BaseModel): - access_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessToken", - title=("AccessToken references to k8 secret which holds the gitlab api access" " information"), - ) - delete_hook_on_finish: Optional[bool] = Field( - default=None, - alias="deleteHookOnFinish", - title=( - "DeleteHookOnFinish determines whether to delete the GitLab hook for the" - " project once the event source is stopped.\n+optional" - ), - ) - enable_ssl_verification: Optional[bool] = Field( - default=None, - alias="enableSSLVerification", - title="EnableSSLVerification to enable ssl verification\n+optional", - ) - events: Optional[List[str]] = Field( - default=None, - description=( - "Events are gitlab event to listen to.\nRefer" - " https://github.com/xanzy/go-gitlab/blob/bf34eca5d13a9f4c3f501d8a97b8ac226d55e4d9/projects.go#L794." - ), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - gitlab_base_url: Optional[str] = Field( - default=None, - alias="gitlabBaseURL", - title="GitlabBaseURL is the base URL for API requests to a custom endpoint", - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - project_id: Optional[str] = Field( - default=None, - alias="projectID", - title=( - "DeprecatedProjectID is the id of project for which integration needs to" - " setup\nDeprecated: use Projects instead. Will be unsupported in v" - " 1.7\n+optional" - ), - ) - projects: Optional[List[str]] = Field( - default=None, - title='List of project IDs or project namespace paths like "whynowy/test"', - ) - secret_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretToken", - title=("SecretToken references to k8 secret which holds the Secret Token used by" " webhook config"), - ) - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration to run a http server") +class KafkaEventSource(BaseModel): + config: Annotated[ + Optional[str], + Field( + description=( + "Yaml format Sarama config for Kafka connection.\nIt follows the struct" + " of sarama.Config. See" + " https://github.com/Shopify/sarama/blob/main/config.go\ne.g.\n\nconsumer:\n" + " fetch:\n min: 1\nnet:\n MaxOpenRequests: 5\n\n+optional" + ) + ), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + description="Backoff holds parameters applied to connection.", + ), + ] = None + consumer_group: Annotated[ + Optional[KafkaConsumerGroup], + Field(alias="consumerGroup", title="Consumer group for kafka client\n+optional"), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + limit_events_per_second: Annotated[ + Optional[str], + Field( + alias="limitEventsPerSecond", + title=("Sets a limit on how many events get read from kafka per" " second.\n+optional"), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + partition: Annotated[Optional[str], Field(title="Partition name")] = None + sasl: Annotated[ + Optional[SASLConfig], + Field(title="SASL configuration for the kafka client\n+optional"), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the kafka client.\n+optional"), + ] = None + topic: Annotated[Optional[str], Field(title="Topic name")] = None + url: Annotated[ + Optional[str], + Field(title="URL to kafka cluster, multiple URLs separated by comma"), + ] = None + version: Annotated[ + Optional[str], + Field( + title=( + "Specify what kafka version is being connected to enables certain" + " features in sarama, defaults to 1.0.0\n+optional" + ) + ), + ] = None -class KafkaEventSource(BaseModel): - config: Optional[str] = Field( - default=None, - description=( - "Yaml format Sarama config for Kafka connection.\nIt follows the struct of" - " sarama.Config. See" - " https://github.com/Shopify/sarama/blob/main/config.go\ne.g.\n\nconsumer:\n" - " fetch:\n min: 1\nnet:\n MaxOpenRequests: 5\n\n+optional" - ), - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - description="Backoff holds parameters applied to connection.", - ) - consumer_group: Optional[KafkaConsumerGroup] = Field( - default=None, - alias="consumerGroup", - title="Consumer group for kafka client\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - limit_events_per_second: Optional[str] = Field( - default=None, - alias="limitEventsPerSecond", - title=("Sets a limit on how many events get read from kafka per second.\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - partition: Optional[str] = Field(default=None, title="Partition name") - sasl: Optional[SASLConfig] = Field(default=None, title="SASL configuration for the kafka client\n+optional") - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the kafka client.\n+optional") - topic: Optional[str] = Field(default=None, title="Topic name") - url: Optional[str] = Field(default=None, title="URL to kafka cluster, multiple URLs separated by comma") - version: Optional[str] = Field( - default=None, - title=( - "Specify what kafka version is being connected to enables certain features" - " in sarama, defaults to 1.0.0\n+optional" - ), - ) +class MQTTEventSource(BaseModel): + client_id: Annotated[Optional[str], Field(alias="clientId", title="ClientID is the id of the client")] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + description="ConnectionBackoff holds backoff applied to connection.", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the mqtt client.\n+optional"), + ] = None + topic: Annotated[Optional[str], Field(title="Topic name")] = None + url: Annotated[Optional[str], Field(title="URL to connect to broker")] = None -class KafkaTrigger(BaseModel): - compress: Optional[bool] = Field( - default=None, - title=( - "Compress determines whether to compress message or not.\nDefaults to" - " false.\nIf set to true, compresses message using snappy" - " compression.\n+optional" - ), - ) - flush_frequency: Optional[int] = Field( - default=None, - alias="flushFrequency", - title=( - "FlushFrequency refers to the frequency in milliseconds to flush" - " batches.\nDefaults to 500 milliseconds.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=("Parameters is the list of parameters that is applied to resolved Kafka" " trigger object."), - ) - partition: Optional[int] = Field(default=None, description="Partition to write data to.") - partitioning_key: Optional[str] = Field( - default=None, - alias="partitioningKey", - description=( - "The partitioning key for the messages put on the Kafka topic.\nDefaults to" " broker url.\n+optional." - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - required_acks: Optional[int] = Field( - default=None, - alias="requiredAcks", - description=( - "RequiredAcks used in producer to tell the broker how many replica" - " acknowledgements\nDefaults to 1 (Only wait for the leader to" - " ack).\n+optional." - ), - ) - sasl: Optional[SASLConfig] = Field(default=None, title="SASL configuration for the kafka client\n+optional") - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the Kafka producer.\n+optional") - topic: Optional[str] = Field( - default=None, - title=("Name of the topic.\nMore info at" " https://kafka.apache.org/documentation/#intro_topics"), - ) - url: Optional[str] = Field( - default=None, - description="URL of the Kafka broker, multiple URLs separated by comma.", - ) - version: Optional[str] = Field( - default=None, - title=( - "Specify what kafka version is being connected to enables certain features" - " in sarama, defaults to 1.0.0\n+optional" - ), - ) +class NSQEventSource(BaseModel): + channel: Annotated[Optional[str], Field(title="Channel used for subscription")] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + host_address: Annotated[ + Optional[str], + Field( + alias="hostAddress", + title="HostAddress is the address of the host for NSQ lookup", + ), + ] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the nsq client.\n+optional"), + ] = None + topic: Annotated[Optional[str], Field(description="Topic to subscribe to.")] = None -class MQTTEventSource(BaseModel): - client_id: Optional[str] = Field(default=None, alias="clientId", title="ClientID is the id of the client") - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - description="ConnectionBackoff holds backoff applied to connection.", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the mqtt client.\n+optional") - topic: Optional[str] = Field(default=None, title="Topic name") - url: Optional[str] = Field(default=None, title="URL to connect to broker") +class PulsarEventSource(BaseModel): + auth_token_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="authTokenSecret", + title="Authentication token for the pulsar client.\n+optional", + ), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the pulsar client.\n+optional"), + ] = None + tls_allow_insecure_connection: Annotated[ + Optional[bool], + Field( + alias="tlsAllowInsecureConnection", + title=("Whether the Pulsar client accept untrusted TLS certificate from" " broker.\n+optional"), + ), + ] = None + tls_trust_certs_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="tlsTrustCertsSecret", + title="Trusted TLS certificate secret.\n+optional", + ), + ] = None + tls_validate_hostname: Annotated[ + Optional[bool], + Field( + alias="tlsValidateHostname", + title=("Whether the Pulsar client verify the validity of the host name from" " broker.\n+optional"), + ), + ] = None + topics: Annotated[ + Optional[List[str]], + Field(title="Name of the topics to subscribe to.\n+required"), + ] = None + type: Annotated[ + Optional[str], + Field( + title=( + 'Type of the subscription.\nOnly "exclusive" and "shared" is' + " supported.\nDefaults to exclusive.\n+optional" + ) + ), + ] = None + url: Annotated[ + Optional[str], + Field(title="Configure the service URL for the Pulsar service.\n+required"), + ] = None -class NATSEventsSource(BaseModel): - auth: Optional[NATSAuth] = Field(default=None, title="Auth information\n+optional") - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - description="ConnectionBackoff holds backoff applied to connection.", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - subject: Optional[str] = Field( - default=None, - title="Subject holds the name of the subject onto which messages are published", - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the nats client.\n+optional") - url: Optional[str] = Field(default=None, title="URL to connect to NATS cluster") +class PulsarTrigger(BaseModel): + auth_token_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="authTokenSecret", + title="Authentication token for the pulsar client.\n+optional", + ), + ] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + title="Backoff holds parameters applied to connection.\n+optional", + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=("Parameters is the list of parameters that is applied to resolved Kafka" " trigger object.") + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the pulsar client.\n+optional"), + ] = None + tls_allow_insecure_connection: Annotated[ + Optional[bool], + Field( + alias="tlsAllowInsecureConnection", + title=("Whether the Pulsar client accept untrusted TLS certificate from" " broker.\n+optional"), + ), + ] = None + tls_trust_certs_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="tlsTrustCertsSecret", + title="Trusted TLS certificate secret.\n+optional", + ), + ] = None + tls_validate_hostname: Annotated[ + Optional[bool], + Field( + alias="tlsValidateHostname", + title=("Whether the Pulsar client verify the validity of the host name from" " broker.\n+optional"), + ), + ] = None + topic: Annotated[ + Optional[str], + Field(title=("Name of the topic.\nSee" " https://pulsar.apache.org/docs/en/concepts-messaging/")), + ] = None + url: Annotated[ + Optional[str], + Field(title="Configure the service URL for the Pulsar service.\n+required"), + ] = None -class NATSTrigger(BaseModel): - parameters: Optional[List[TriggerParameter]] = None - payload: Optional[List[TriggerParameter]] = None - subject: Optional[str] = Field(default=None, description="Name of the subject to put message on.") - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the NATS producer.\n+optional") - url: Optional[str] = Field(default=None, description="URL of the NATS cluster.") +class CalendarEventSource(BaseModel): + exclusion_dates: Annotated[ + Optional[List[str]], + Field( + alias="exclusionDates", + description=("ExclusionDates defines the list of DATE-TIME exceptions for recurring" " events."), + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + interval: Annotated[ + Optional[str], + Field(title=("Interval is a string that describes an interval duration, e.g. 1s," " 30m, 2h...\n+optional")), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + persistence: Annotated[ + Optional[EventPersistence], + Field(title="Persistence hold the configuration for event persistence"), + ] = None + schedule: Annotated[ + Optional[str], + Field( + title=( + "Schedule is a cron-like expression. For reference, see:" + " https://en.wikipedia.org/wiki/Cron\n+optional" + ) + ), + ] = None + timezone: Annotated[Optional[str], Field(title="Timezone in which to run the schedule\n+optional")] = None -class NSQEventSource(BaseModel): - channel: Optional[str] = Field(default=None, title="Channel used for subscription") - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - host_address: Optional[str] = Field( - default=None, - alias="hostAddress", - title="HostAddress is the address of the host for NSQ lookup", - ) - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the nsq client.\n+optional") - topic: Optional[str] = Field(default=None, description="Topic to subscribe to.") +class NATSEventsSource(BaseModel): + auth: Annotated[Optional[NATSAuth], Field(title="Auth information\n+optional")] = None + connection_backoff: Annotated[ + Optional[Backoff], + Field( + alias="connectionBackoff", + description="ConnectionBackoff holds backoff applied to connection.", + ), + ] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + json_body: Annotated[ + Optional[bool], + Field( + alias="jsonBody", + title=( + "JSONBody specifies that all event body payload coming from" " this\nsource will be JSON\n+optional" + ), + ), + ] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=("Metadata holds the user defined metadata which will passed along the" " event payload.\n+optional") + ), + ] = None + subject: Annotated[ + Optional[str], + Field(title=("Subject holds the name of the subject onto which messages are" " published")), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the nats client.\n+optional"), + ] = None + url: Annotated[Optional[str], Field(title="URL to connect to NATS cluster")] = None -class OpenWhiskTrigger(BaseModel): - action_name: Optional[str] = Field(default=None, alias="actionName", description="Name of the action/function.") - auth_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authToken", - title="AuthToken for authentication.\n+optional", - ) - host: Optional[str] = Field(default=None, description="Host URL of the OpenWhisk.") - namespace: Optional[str] = Field( - default=None, - description='Namespace for the action.\nDefaults to "_".\n+optional.', - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe trigger resource.\n+optional" - ), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - version: Optional[str] = Field(default=None, title="Version for the API.\nDefaults to v1.\n+optional") +class BitbucketEventSource(BaseModel): + auth: Annotated[ + Optional[BitbucketAuth], + Field(description="Auth information required to connect to Bitbucket."), + ] = None + delete_hook_on_finish: Annotated[ + Optional[bool], + Field( + alias="deleteHookOnFinish", + title=( + "DeleteHookOnFinish determines whether to delete the defined Bitbucket" + " hook once the event source is stopped.\n+optional" + ), + ), + ] = None + events: Annotated[Optional[List[str]], Field(description="Events this webhook is subscribed to.")] = None + filter: Annotated[Optional[EventSourceFilter], Field(title="Filter\n+optional")] = None + metadata: Annotated[ + Optional[Dict[str, str]], + Field( + title=( + "Metadata holds the user defined metadata which will be passed along" " the event payload.\n+optional" + ) + ), + ] = None + owner: Annotated[ + Optional[str], + Field( + title=( + "DeprecatedOwner is the owner of the repository.\nDeprecated: use" + " Repositories instead. Will be unsupported in v1.9\n+optional" + ) + ), + ] = None + project_key: Annotated[ + Optional[str], + Field( + alias="projectKey", + title=( + "DeprecatedProjectKey is the key of the project to which the repository" + " relates\nDeprecated: use Repositories instead. Will be unsupported in" + " v1.9\n+optional" + ), + ), + ] = None + repositories: Annotated[ + Optional[List[BitbucketRepository]], + Field(title=("Repositories holds a list of repositories for which integration needs" " to set up\n+optional")), + ] = None + repository_slug: Annotated[ + Optional[str], + Field( + alias="repositorySlug", + title=( + "DeprecatedRepositorySlug is a URL-friendly version of a repository" + " name, automatically generated by Bitbucket for use in the" + " URL\nDeprecated: use Repositories instead. Will be unsupported in" + " v1.9\n+optional" + ), + ), + ] = None + webhook: Annotated[ + Optional[WebhookContext], + Field(title="Webhook refers to the configuration required to run an http server"), + ] = None -class PulsarEventSource(BaseModel): - auth_token_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authTokenSecret", - title="Authentication token for the pulsar client.\n+optional", - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the pulsar client.\n+optional") - tls_allow_insecure_connection: Optional[bool] = Field( - default=None, - alias="tlsAllowInsecureConnection", - title=("Whether the Pulsar client accept untrusted TLS certificate from" " broker.\n+optional"), - ) - tls_trust_certs_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="tlsTrustCertsSecret", - title="Trusted TLS certificate secret.\n+optional", - ) - tls_validate_hostname: Optional[bool] = Field( - default=None, - alias="tlsValidateHostname", - title=("Whether the Pulsar client verify the validity of the host name from" " broker.\n+optional"), - ) - topics: Optional[List[str]] = Field(default=None, title="Name of the topics to subscribe to.\n+required") - type: Optional[str] = Field( - default=None, - title=( - 'Type of the subscription.\nOnly "exclusive" and "shared" is' - " supported.\nDefaults to exclusive.\n+optional" - ), - ) - url: Optional[str] = Field( - default=None, - title="Configure the service URL for the Pulsar service.\n+required", - ) +class ArtifactLocation(BaseModel): + configmap: Annotated[ + Optional[v1_1.ConfigMapKeySelector], + Field(title="Configmap that stores the artifact"), + ] = None + file: Annotated[ + Optional[FileArtifact], + Field(title="File artifact is artifact stored in a file"), + ] = None + git: Annotated[Optional[GitArtifact], Field(title="Git repository hosting the artifact")] = None + inline: Annotated[ + Optional[str], + Field(title="Inline artifact is embedded in sensor spec as a string"), + ] = None + resource: Annotated[Optional[Resource], Field(title="Resource is generic template for K8s resource")] = None + s3: Annotated[Optional[S3Artifact], Field(title="S3 compliant artifact")] = None + url: Annotated[Optional[URLArtifact], Field(title="URL to fetch the artifact from")] = None -class PulsarTrigger(BaseModel): - auth_token_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="authTokenSecret", - title="Authentication token for the pulsar client.\n+optional", - ) - connection_backoff: Optional[Backoff] = Field( - default=None, - alias="connectionBackoff", - title="Backoff holds parameters applied to connection.\n+optional", - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=("Parameters is the list of parameters that is applied to resolved Kafka" " trigger object."), - ) - payload: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Payload is the list of key-value extracted from an event payload to" " construct the request payload." - ), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the pulsar client.\n+optional") - tls_allow_insecure_connection: Optional[bool] = Field( - default=None, - alias="tlsAllowInsecureConnection", - title=("Whether the Pulsar client accept untrusted TLS certificate from" " broker.\n+optional"), - ) - tls_trust_certs_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="tlsTrustCertsSecret", - title="Trusted TLS certificate secret.\n+optional", - ) - tls_validate_hostname: Optional[bool] = Field( - default=None, - alias="tlsValidateHostname", - title=("Whether the Pulsar client verify the validity of the host name from" " broker.\n+optional"), - ) - topic: Optional[str] = Field( - default=None, - title=("Name of the topic.\nSee" " https://pulsar.apache.org/docs/en/concepts-messaging/"), - ) - url: Optional[str] = Field( - default=None, - title="Configure the service URL for the Pulsar service.\n+required", - ) +class TriggerPolicy(BaseModel): + k8s: Annotated[ + Optional[K8SResourcePolicy], + Field( + title=( + "K8SResourcePolicy refers to the policy used to check the state of K8s" + " based triggers using using labels" + ) + ), + ] = None + status: Annotated[ + Optional[StatusPolicy], + Field(title=("Status refers to the policy used to check the state of the trigger" " using response status")), + ] = None -class RedisEventSource(BaseModel): - channels: Optional[List[str]] = None - db: Optional[int] = Field( - default=None, - title="DB to use. If not specified, default DB 0 will be used.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - host_address: Optional[str] = Field( - default=None, - alias="hostAddress", - title="HostAddress refers to the address of the Redis host/server", - ) - json_body: Optional[bool] = Field( - default=None, - alias="jsonBody", - title=("JSONBody specifies that all event body payload coming from this\nsource" " will be JSON\n+optional"), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - namespace: Optional[str] = Field( - default=None, - title=( - "Namespace to use to retrieve the password from. It should only be" - " specified if password is declared\n+optional" - ), - ) - password: Optional[v1.SecretKeySelector] = Field( - default=None, title="Password required for authentication if any.\n+optional" - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the redis client.\n+optional") - username: Optional[str] = Field( - default=None, - title="Username required for ACL style authentication if any.\n+optional", - ) +class ArgoWorkflowTrigger(BaseModel): + args: Annotated[ + Optional[List[str]], + Field(title="Args is the list of arguments to pass to the argo CLI"), + ] = None + operation: Annotated[ + Optional[str], + Field( + title=( + "Operation refers to the type of operation performed on the argo" + " workflow resource.\nDefault value is Submit.\n+optional" + ) + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field(title=("Parameters is the list of parameters to pass to resolved Argo Workflow" " object")), + ] = None + source: Annotated[Optional[ArtifactLocation], Field(title="Source of the K8s resource file(s)")] = None -class RedisStreamEventSource(BaseModel): - consumer_group: Optional[str] = Field( - default=None, - alias="consumerGroup", - title=( - "ConsumerGroup refers to the Redis stream consumer group that will" - " be\ncreated on all redis streams. Messages are read through this group." - " Defaults to 'argo-events-cg'\n+optional" - ), - ) - db: Optional[int] = Field( - default=None, - title="DB to use. If not specified, default DB 0 will be used.\n+optional", - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - host_address: Optional[str] = Field( - default=None, - alias="hostAddress", - title=("HostAddress refers to the address of the Redis host/server (master" " instance)"), - ) - max_msg_count_per_read: Optional[int] = Field( - default=None, - alias="maxMsgCountPerRead", - title=( - "MaxMsgCountPerRead holds the maximum number of messages per stream that" - " will be read in each XREADGROUP of all streams\nExample: if there are 2" - " streams and MaxMsgCountPerRead=10, then each XREADGROUP may read upto a" - " total of 20 messages.\nSame as COUNT option in" - " XREADGROUP(https://redis.io/topics/streams-intro). Defaults to" - " 10\n+optional" - ), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - password: Optional[v1.SecretKeySelector] = Field( - default=None, title="Password required for authentication if any.\n+optional" - ) - streams: Optional[List[str]] = Field( - default=None, - description=( - "Streams to look for entries. XREADGROUP is used on all streams using a" " single consumer group." - ), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the redis client.\n+optional") - username: Optional[str] = Field( - default=None, - title="Username required for ACL style authentication if any.\n+optional", - ) +class StandardK8STrigger(BaseModel): + live_object: Annotated[ + Optional[bool], + Field( + alias="liveObject", + title=( + "LiveObject specifies whether the resource should be directly fetched" + " from K8s instead\nof being marshaled from the resource artifact. If" + " set to true, the resource artifact\nmust contain the information" + " required to uniquely identify the resource in the cluster,\nthat is," + ' you must specify "apiVersion", "kind" as well as "name" and' + ' "namespace" meta\ndata.\nOnly valid for operation type' + " `update`\n+optional" + ), + ), + ] = None + operation: Annotated[ + Optional[str], + Field( + title=( + "Operation refers to the type of operation performed on the k8s" + " resource.\nDefault value is Create.\n+optional" + ) + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field(description=("Parameters is the list of parameters that is applied to resolved K8s" " trigger object.")), + ] = None + patch_strategy: Annotated[ + Optional[str], + Field( + alias="patchStrategy", + title=( + "PatchStrategy controls the K8s object patching strategy when the" + " trigger operation is specified as patch.\npossible" + ' values:\n"application/json-patch+json"\n"application/merge-patch+json"\n"application/strategic-merge-patch+json"\n"application/apply-patch+yaml".\nDefaults' + ' to "application/merge-patch+json"\n+optional' + ), + ), + ] = None + source: Annotated[Optional[ArtifactLocation], Field(title="Source of the K8s resource file(s)")] = None -class ResourceEventSource(BaseModel): - event_types: Optional[List[str]] = Field( - default=None, - alias="eventTypes", - description=( - "EventTypes is the list of event type to watch.\nPossible values are - ADD," " UPDATE and DELETE." - ), - ) - filter: Optional[ResourceFilter] = Field( - default=None, - title=( - "Filter is applied on the metadata of the resource\nIf you apply filter," - " then the internal event informer will only monitor objects that pass the" - " filter.\n+optional" - ), - ) - group_version_resource: Optional[v1_1.GroupVersionResource] = Field( - default=None, alias="groupVersionResource", title="Group of the resource" - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - namespace: Optional[str] = Field(default=None, title="Namespace where resource is deployed") +class Service(BaseModel): + cluster_ip: Annotated[ + Optional[str], + Field( + alias="clusterIP", + title=( + "clusterIP is the IP address of the service and is usually" + " assigned\nrandomly by the master. If an address is specified manually" + " and is not in\nuse by others, it will be allocated to the service;" + " otherwise, creation\nof the service will fail. This field can not be" + ' changed through updates.\nValid values are "None", empty string (""),' + ' or a valid IP address. "None"\ncan be specified for headless services' + " when proxying is not required.\nMore info:" + " https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies\n+optional" + ), + ), + ] = None + ports: Annotated[ + Optional[List[v1_1.ServicePort]], + Field( + title=( + "The list of ports that are exposed by this ClusterIP" + " service.\n+patchMergeKey=port\n+patchStrategy=merge\n+listType=map\n+listMapKey=port\n+listMapKey=protocol" + ) + ), + ] = None -class SNSEventSource(BaseModel): - access_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKey", - title="AccessKey refers K8s secret containing aws access key", - ) - endpoint: Optional[str] = Field( - default=None, - title=("Endpoint configures connection to a specific SNS endpoint instead of" " Amazons servers\n+optional"), - ) - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - region: Optional[str] = Field(default=None, title="Region is AWS region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), - ) - secret_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKey", - title="SecretKey refers K8s secret containing aws secret key", - ) - topic_arn: Optional[str] = Field(default=None, alias="topicArn", title="TopicArn") - validate_signature: Optional[bool] = Field( - default=None, - alias="validateSignature", - title=("ValidateSignature is boolean that can be set to true for SNS signature" " verification\n+optional"), - ) - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook configuration for http server") +class Status(BaseModel): + conditions: Annotated[ + Optional[List[Condition]], + Field( + title=( + "Conditions are the latest available observations of a resource's" + " current state.\n+optional\n+patchMergeKey=type\n+patchStrategy=merge" + ) + ), + ] = None -class SecureHeader(BaseModel): - name: Optional[str] = None - value_from: Optional[ValueFromSource] = Field( - default=None, - alias="valueFrom", - title="Values can be read from either secrets or configmaps", - ) +class ExprFilter(BaseModel): + expr: Annotated[ + Optional[str], + Field(description=("Expr refers to the expression that determines the outcome of the" " filter.")), + ] = None + fields: Annotated[ + Optional[List[PayloadField]], + Field(description=("Fields refers to set of keys that refer to the paths within event" " payload.")), + ] = None -class SensorStatus(BaseModel): - status: Optional[Status] = None +class AWSLambdaTrigger(BaseModel): + access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="accessKey", + title="AccessKey refers K8s secret containing aws access key\n+optional", + ), + ] = None + function_name: Annotated[ + Optional[str], + Field( + alias="functionName", + description="FunctionName refers to the name of the function to invoke.", + ), + ] = None + invocation_type: Annotated[ + Optional[str], + Field( + alias="invocationType", + description=( + "Choose from the following options.\n\n * RequestResponse (default) -" + " Invoke the function synchronously. Keep\n the connection open until" + " the function returns a response or times out.\n The API response" + " includes the function response and additional data.\n\n * Event -" + " Invoke the function asynchronously. Send events that fail multiple\n " + " times to the function's dead-letter queue (if it's configured). The" + " API\n response only includes a status code.\n\n * DryRun -" + " Validate parameter values and verify that the user or role\n has" + " permission to invoke the function.\n+optional" + ), + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + title=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe trigger resource.\n+optional" + ) + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + region: Annotated[Optional[str], Field(title="Region is AWS region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + title=("RoleARN is the Amazon Resource Name (ARN) of the role to" " assume.\n+optional"), + ), + ] = None + secret_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="secretKey", + title="SecretKey refers K8s secret containing aws secret key\n+optional", + ), + ] = None -class Service(BaseModel): - cluster_ip: Optional[str] = Field( - default=None, - alias="clusterIP", - title=( - "clusterIP is the IP address of the service and is usually" - " assigned\nrandomly by the master. If an address is specified manually and" - " is not in\nuse by others, it will be allocated to the service; otherwise," - " creation\nof the service will fail. This field can not be changed through" - ' updates.\nValid values are "None", empty string (""), or a valid IP' - ' address. "None"\ncan be specified for headless services when proxying is' - " not required.\nMore info:" - " https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies\n+optional" - ), - ) - ports: Optional[List[v1.ServicePort]] = Field( - default=None, - title=( - "The list of ports that are exposed by this ClusterIP" - " service.\n+patchMergeKey=port\n+patchStrategy=merge\n+listType=map\n+listMapKey=port\n+listMapKey=protocol" - ), - ) +class AzureEventHubsTrigger(BaseModel): + fqdn: Annotated[ + Optional[str], + Field( + title=( + "FQDN refers to the namespace dns of Azure Event Hubs to be used i.e." + " .servicebus.windows.net" + ) + ), + ] = None + hub_name: Annotated[ + Optional[str], + Field( + alias="hubName", + title="HubName refers to the Azure Event Hub to send events to", + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + title=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe trigger resource.\n+optional" + ) + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + shared_access_key: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sharedAccessKey", + title=("SharedAccessKey refers to a K8s secret containing the primary key" " for the"), + ), + ] = None + shared_access_key_name: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="sharedAccessKeyName", + title="SharedAccessKeyName refers to the name of the Shared Access Key", + ), + ] = None -class SlackEventSource(BaseModel): - filter: Optional[EventSourceFilter] = Field(default=None, title="Filter\n+optional") - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - signing_secret: Optional[v1.SecretKeySelector] = Field( - default=None, alias="signingSecret", title="Slack App signing secret" - ) - token: Optional[v1.SecretKeySelector] = Field(default=None, title="Token for URL verification handshake") - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration for a REST endpoint") +class CustomTrigger(BaseModel): + cert_secret: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="certSecret", + description=( + "CertSecret refers to the secret that contains cert for secure" + " connection between sensor and custom trigger gRPC server." + ), + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Parameters is the list of parameters that is applied to resolved" " custom trigger trigger object." + ) + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + secure: Annotated[ + Optional[bool], + Field(title=("Secure refers to type of the connection between sensor to custom" " trigger gRPC")), + ] = None + server_name_override: Annotated[ + Optional[str], + Field( + alias="serverNameOverride", + description=( + "ServerNameOverride for the secure connection between sensor and custom" " trigger gRPC server." + ), + ), + ] = None + server_url: Annotated[ + Optional[str], + Field( + alias="serverURL", + title=("ServerURL is the url of the gRPC server that executes custom trigger"), + ), + ] = None + spec: Annotated[ + Optional[Dict[str, str]], + Field( + description=( + "Spec is the custom trigger resource specification that custom trigger" + " gRPC server knows how to interpret." + ) + ), + ] = None -class SlackTrigger(BaseModel): - channel: Optional[str] = Field( - default=None, - title="Channel refers to which Slack channel to send slack message.\n+optional", - ) - message: Optional[str] = Field( - default=None, - title="Message refers to the message to send to the Slack channel.\n+optional", - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe trigger resource.\n+optional" - ), - ) - slack_token: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="slackToken", - description=( - "SlackToken refers to the Kubernetes secret that holds the slack token" " required to send messages." - ), - ) +class OpenWhiskTrigger(BaseModel): + action_name: Annotated[ + Optional[str], + Field(alias="actionName", description="Name of the action/function."), + ] = None + auth_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field(alias="authToken", title="AuthToken for authentication.\n+optional"), + ] = None + host: Annotated[Optional[str], Field(description="Host URL of the OpenWhisk.")] = None + namespace: Annotated[ + Optional[str], + Field(description='Namespace for the action.\nDefaults to "_".\n+optional.'), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + title=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe trigger resource.\n+optional" + ) + ), + ] = None + payload: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Payload is the list of key-value extracted from an event payload to" " construct the request payload." + ) + ), + ] = None + version: Annotated[Optional[str], Field(title="Version for the API.\nDefaults to v1.\n+optional")] = None -class StorageGridEventSource(BaseModel): - api_url: Optional[str] = Field( - default=None, - alias="apiURL", - description="APIURL is the url of the storagegrid api.", - ) - auth_token: Optional[v1.SecretKeySelector] = Field( - default=None, alias="authToken", title="Auth token for storagegrid api" - ) - bucket: Optional[str] = Field(default=None, description="Name of the bucket to register notifications for.") - events: Optional[List[str]] = None - filter: Optional[StorageGridFilter] = Field( - default=None, description="Filter on object key which caused the notification." - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - region: Optional[str] = Field(default=None, title="S3 region.\nDefaults to us-east-1\n+optional") - topic_arn: Optional[str] = Field(default=None, alias="topicArn", title="TopicArn") - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration for a REST endpoint") +class SlackTrigger(BaseModel): + channel: Annotated[ + Optional[str], + Field(title=("Channel refers to which Slack channel to send slack" " message.\n+optional")), + ] = None + message: Annotated[ + Optional[str], + Field(title=("Message refers to the message to send to the Slack channel.\n+optional")), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + title=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe trigger resource.\n+optional" + ) + ), + ] = None + slack_token: Annotated[ + Optional[v1_1.SecretKeySelector], + Field( + alias="slackToken", + description=( + "SlackToken refers to the Kubernetes secret that holds the slack token" " required to send messages." + ), + ), + ] = None -class StripeEventSource(BaseModel): - api_key: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="apiKey", - title=( - "APIKey refers to K8s secret that holds Stripe API key. Used only if" - " CreateWebhook is enabled.\n+optional" - ), - ) - create_webhook: Optional[bool] = Field( - default=None, - alias="createWebhook", - title=("CreateWebhook if specified creates a new webhook" " programmatically.\n+optional"), - ) - event_filter: Optional[List[str]] = Field( - default=None, - alias="eventFilter", - title=( - "EventFilter describes the type of events to listen to. If not specified," - " all types of events will be processed.\nMore info at" - " https://stripe.com/docs/api/events/list\n+optional" - ), - ) - metadata: Optional[Dict[str, str]] = Field( - default=None, - title=("Metadata holds the user defined metadata which will passed along the event" " payload.\n+optional"), - ) - webhook: Optional[WebhookContext] = Field(default=None, title="Webhook holds configuration for a REST endpoint") +class EventSourceStatus(BaseModel): + status: Optional[Status] = None -class ArtifactLocation(BaseModel): - configmap: Optional[v1.ConfigMapKeySelector] = Field(default=None, title="Configmap that stores the artifact") - file: Optional[FileArtifact] = Field(default=None, title="File artifact is artifact stored in a file") - git: Optional[GitArtifact] = Field(default=None, title="Git repository hosting the artifact") - inline: Optional[str] = Field(default=None, title="Inline artifact is embedded in sensor spec as a string") - resource: Optional[Resource] = Field(default=None, title="Resource is generic template for K8s resource") - s3: Optional[S3Artifact] = Field(default=None, title="S3 compliant artifact") - url: Optional[URLArtifact] = Field(default=None, title="URL to fetch the artifact from") +class SensorStatus(BaseModel): + status: Optional[Status] = None -class EventDependency(BaseModel): - event_name: Optional[str] = Field(default=None, alias="eventName", title="EventName is the name of the event") - event_source_name: Optional[str] = Field( - default=None, - alias="eventSourceName", - title="EventSourceName is the name of EventSource that Sensor depends on", - ) - filters: Optional[EventDependencyFilter] = Field( - default=None, - title=( - "Filters and rules governing toleration of success and constraints on the" " context and data of an event" - ), - ) - filters_logical_operator: Optional[str] = Field( - default=None, - alias="filtersLogicalOperator", - description=( - "FiltersLogicalOperator defines how different filters are evaluated" - " together.\nAvailable values: and (&&), or (||)\nIs optional and if left" - " blank treated as and (&&)." - ), - ) - name: Optional[str] = Field(default=None, title="Name is a unique name of this dependency") - transform: Optional[EventDependencyTransformer] = Field(default=None, title="Transform transforms the event data") +class EventDependencyFilter(BaseModel): + context: Annotated[Optional[EventContext], Field(title="Context filter constraints")] = None + data: Annotated[ + Optional[List[DataFilter]], + Field(title="Data filter constraints with escalation"), + ] = None + data_logical_operator: Annotated[ + Optional[str], + Field( + alias="dataLogicalOperator", + description=( + "DataLogicalOperator defines how multiple Data filters (if defined) are" + " evaluated together.\nAvailable values: and (&&), or (||)\nIs optional" + " and if left blank treated as and (&&)." + ), + ), + ] = None + expr_logical_operator: Annotated[ + Optional[str], + Field( + alias="exprLogicalOperator", + description=( + "ExprLogicalOperator defines how multiple Exprs filters (if defined)" + " are evaluated together.\nAvailable values: and (&&), or (||)\nIs" + " optional and if left blank treated as and (&&)." + ), + ), + ] = None + exprs: Annotated[ + Optional[List[ExprFilter]], + Field(description=("Exprs contains the list of expressions evaluated against the event" " payload.")), + ] = None + script: Annotated[ + Optional[str], + Field( + description=( + "Script refers to a Lua script evaluated to determine the validity of" + " an io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + time: Annotated[Optional[TimeFilter], Field(title="Time filter on the event with escalation")] = None class HTTPTrigger(BaseModel): - basic_auth: Optional[BasicAuth] = Field( - default=None, - alias="basicAuth", - title="BasicAuth configuration for the http request.\n+optional", - ) - headers: Optional[Dict[str, str]] = Field(default=None, title="Headers for the HTTP request.\n+optional") - method: Optional[str] = Field( - default=None, - title=( - "Method refers to the type of the HTTP request.\nRefer" - " https://golang.org/src/net/http/method.go for more" - " io.argoproj.workflow.v1alpha1.\nDefault value is POST.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=( - "Parameters is the list of key-value extracted from event's payload that" - " are applied to\nthe HTTP trigger resource." - ), - ) + basic_auth: Annotated[ + Optional[BasicAuth], + Field( + alias="basicAuth", + title="BasicAuth configuration for the http request.\n+optional", + ), + ] = None + headers: Annotated[ + Optional[Dict[str, str]], + Field(title="Headers for the HTTP request.\n+optional"), + ] = None + method: Annotated[ + Optional[str], + Field( + title=( + "Method refers to the type of the HTTP request.\nRefer" + " https://golang.org/src/net/http/method.go for more" + " io.argoproj.workflow.v1alpha1.\nDefault value is POST.\n+optional" + ) + ), + ] = None + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field( + description=( + "Parameters is the list of key-value extracted from event's payload" + " that are applied to\nthe HTTP trigger resource." + ) + ), + ] = None payload: Optional[List[TriggerParameter]] = None - secure_headers: Optional[List[SecureHeader]] = Field( - default=None, - alias="secureHeaders", - title=("Secure Headers stored in Kubernetes Secrets for the HTTP" " requests.\n+optional"), - ) - timeout: Optional[str] = Field( - default=None, - title=("Timeout refers to the HTTP request timeout in seconds.\nDefault value is" " 60 seconds.\n+optional"), - ) - tls: Optional[TLSConfig] = Field(default=None, title="TLS configuration for the HTTP client.\n+optional") - url: Optional[str] = Field(default=None, description="URL refers to the URL to send HTTP request to.") + secure_headers: Annotated[ + Optional[List[SecureHeader]], + Field( + alias="secureHeaders", + title=("Secure Headers stored in Kubernetes Secrets for the HTTP" " requests.\n+optional"), + ), + ] = None + timeout: Annotated[ + Optional[str], + Field( + title=( + "Timeout refers to the HTTP request timeout in seconds.\nDefault value" " is 60 seconds.\n+optional" + ) + ), + ] = None + tls: Annotated[ + Optional[TLSConfig], + Field(title="TLS configuration for the HTTP client.\n+optional"), + ] = None + url: Annotated[ + Optional[str], + Field(description="URL refers to the URL to send HTTP request to."), + ] = None -class StandardK8STrigger(BaseModel): - live_object: Optional[bool] = Field( - default=None, - alias="liveObject", - title=( - "LiveObject specifies whether the resource should be directly fetched from" - " K8s instead\nof being marshaled from the resource artifact. If set to" - " true, the resource artifact\nmust contain the information required to" - " uniquely identify the resource in the cluster,\nthat is, you must specify" - ' "apiVersion", "kind" as well as "name" and "namespace" meta\ndata.\nOnly' - " valid for operation type `update`\n+optional" - ), - ) - operation: Optional[str] = Field( - default=None, - title=( - "Operation refers to the type of operation performed on the k8s" - " resource.\nDefault value is Create.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - description=("Parameters is the list of parameters that is applied to resolved K8s" " trigger object."), - ) - patch_strategy: Optional[str] = Field( - default=None, - alias="patchStrategy", - title=( - "PatchStrategy controls the K8s object patching strategy when the trigger" - " operation is specified as patch.\npossible" - ' values:\n"application/json-patch+json"\n"application/merge-patch+json"\n"application/strategic-merge-patch+json"\n"application/apply-patch+yaml".\nDefaults' - ' to "application/merge-patch+json"\n+optional' - ), - ) - source: Optional[ArtifactLocation] = Field(default=None, title="Source of the K8s resource file(s)") - - -class ArgoWorkflowTrigger(BaseModel): - args: Optional[List[str]] = Field(default=None, title="Args is the list of arguments to pass to the argo CLI") - operation: Optional[str] = Field( - default=None, - title=( - "Operation refers to the type of operation performed on the argo workflow" - " resource.\nDefault value is Submit.\n+optional" - ), - ) - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=("Parameters is the list of parameters to pass to resolved Argo Workflow" " object"), - ) - source: Optional[ArtifactLocation] = Field(default=None, title="Source of the K8s resource file(s)") +class EventDependency(BaseModel): + event_name: Annotated[ + Optional[str], + Field(alias="eventName", title="EventName is the name of the event"), + ] = None + event_source_name: Annotated[ + Optional[str], + Field( + alias="eventSourceName", + title="EventSourceName is the name of EventSource that Sensor depends on", + ), + ] = None + filters: Annotated[ + Optional[EventDependencyFilter], + Field( + title=( + "Filters and rules governing toleration of success and constraints on" + " the context and data of an event" + ) + ), + ] = None + filters_logical_operator: Annotated[ + Optional[str], + Field( + alias="filtersLogicalOperator", + description=( + "FiltersLogicalOperator defines how different filters are evaluated" + " together.\nAvailable values: and (&&), or (||)\nIs optional and if" + " left blank treated as and (&&)." + ), + ), + ] = None + name: Annotated[Optional[str], Field(title="Name is a unique name of this dependency")] = None + transform: Annotated[ + Optional[EventDependencyTransformer], + Field(title="Transform transforms the event data"), + ] = None class TriggerTemplate(BaseModel): - argo_workflow: Optional[ArgoWorkflowTrigger] = Field( - default=None, - alias="argoWorkflow", - title=( - "ArgoWorkflow refers to the trigger that can perform various operations on" - " an Argo io.argoproj.workflow.v1alpha1.\n+optional" - ), - ) - aws_lambda: Optional[AWSLambdaTrigger] = Field( - default=None, - alias="awsLambda", - title=( - "AWSLambda refers to the trigger designed to invoke AWS Lambda function" - " with with on-the-fly constructable payload.\n+optional" - ), - ) - azure_event_hubs: Optional[AzureEventHubsTrigger] = Field( - default=None, - alias="azureEventHubs", - title=("AzureEventHubs refers to the trigger send an event to an Azure Event" " Hub.\n+optional"), - ) - conditions: Optional[str] = Field( - default=None, - title=( - 'Conditions is the conditions to execute the trigger.\nFor example: "(dep01' - ' || dep02) && dep04"\n+optional' - ), - ) - conditions_reset: Optional[List[ConditionsResetCriteria]] = Field( - default=None, - alias="conditionsReset", - title="Criteria to reset the conditons\n+optional", - ) - custom: Optional[CustomTrigger] = Field( - default=None, - title=( - "CustomTrigger refers to the trigger designed to connect to a gRPC trigger" - " server and execute a custom trigger.\n+optional" - ), - ) - http: Optional[HTTPTrigger] = Field( - default=None, - title=( - "HTTP refers to the trigger designed to dispatch a HTTP request with" - " on-the-fly constructable payload.\n+optional" - ), - ) - k8s: Optional[StandardK8STrigger] = Field( - default=None, - title=( - "StandardK8STrigger refers to the trigger designed to create or update a" - " generic Kubernetes resource.\n+optional" - ), - ) - kafka: Optional[KafkaTrigger] = Field( - default=None, - description=("Kafka refers to the trigger designed to place messages on Kafka" " topic.\n+optional."), - ) - log: Optional[LogTrigger] = Field( - default=None, - title=("Log refers to the trigger designed to invoke log the" " io.argoproj.workflow.v1alpha1.\n+optional"), - ) - name: Optional[str] = Field(default=None, description="Name is a unique name of the action to take.") - nats: Optional[NATSTrigger] = Field( - default=None, - description=("NATS refers to the trigger designed to place message on NATS" " subject.\n+optional."), - ) - open_whisk: Optional[OpenWhiskTrigger] = Field( - default=None, - alias="openWhisk", - title=("OpenWhisk refers to the trigger designed to invoke OpenWhisk" " action.\n+optional"), - ) - pulsar: Optional[PulsarTrigger] = Field( - default=None, - title=("Pulsar refers to the trigger designed to place messages on Pulsar" " topic.\n+optional"), - ) - slack: Optional[SlackTrigger] = Field( - default=None, - title=("Slack refers to the trigger designed to send slack notification" " message.\n+optional"), - ) + argo_workflow: Annotated[ + Optional[ArgoWorkflowTrigger], + Field( + alias="argoWorkflow", + title=( + "ArgoWorkflow refers to the trigger that can perform various operations" + " on an Argo io.argoproj.workflow.v1alpha1.\n+optional" + ), + ), + ] = None + aws_lambda: Annotated[ + Optional[AWSLambdaTrigger], + Field( + alias="awsLambda", + title=( + "AWSLambda refers to the trigger designed to invoke AWS Lambda function" + " with with on-the-fly constructable payload.\n+optional" + ), + ), + ] = None + azure_event_hubs: Annotated[ + Optional[AzureEventHubsTrigger], + Field( + alias="azureEventHubs", + title=("AzureEventHubs refers to the trigger send an event to an Azure Event" " Hub.\n+optional"), + ), + ] = None + conditions: Annotated[ + Optional[str], + Field( + title=( + "Conditions is the conditions to execute the trigger.\nFor example:" + ' "(dep01 || dep02) && dep04"\n+optional' + ) + ), + ] = None + conditions_reset: Annotated[ + Optional[List[ConditionsResetCriteria]], + Field(alias="conditionsReset", title="Criteria to reset the conditons\n+optional"), + ] = None + custom: Annotated[ + Optional[CustomTrigger], + Field( + title=( + "CustomTrigger refers to the trigger designed to connect to a gRPC" + " trigger server and execute a custom trigger.\n+optional" + ) + ), + ] = None + http: Annotated[ + Optional[HTTPTrigger], + Field( + title=( + "HTTP refers to the trigger designed to dispatch a HTTP request with" + " on-the-fly constructable payload.\n+optional" + ) + ), + ] = None + k8s: Annotated[ + Optional[StandardK8STrigger], + Field( + title=( + "StandardK8STrigger refers to the trigger designed to create or update" + " a generic Kubernetes resource.\n+optional" + ) + ), + ] = None + kafka: Annotated[ + Optional[KafkaTrigger], + Field(description=("Kafka refers to the trigger designed to place messages on Kafka" " topic.\n+optional.")), + ] = None + log: Annotated[ + Optional[LogTrigger], + Field( + title=("Log refers to the trigger designed to invoke log the" " io.argoproj.workflow.v1alpha1.\n+optional") + ), + ] = None + name: Annotated[Optional[str], Field(description="Name is a unique name of the action to take.")] = None + nats: Annotated[ + Optional[NATSTrigger], + Field(description=("NATS refers to the trigger designed to place message on NATS" " subject.\n+optional.")), + ] = None + open_whisk: Annotated[ + Optional[OpenWhiskTrigger], + Field( + alias="openWhisk", + title=("OpenWhisk refers to the trigger designed to invoke OpenWhisk" " action.\n+optional"), + ), + ] = None + pulsar: Annotated[ + Optional[PulsarTrigger], + Field(title=("Pulsar refers to the trigger designed to place messages on Pulsar" " topic.\n+optional")), + ] = None + slack: Annotated[ + Optional[SlackTrigger], + Field(title=("Slack refers to the trigger designed to send slack notification" " message.\n+optional")), + ] = None -class Template(BaseModel): - affinity: Optional[v1.Affinity] = Field( - default=None, title="If specified, the pod's scheduling constraints\n+optional" - ) - container: Optional[v1.Container] = Field( - default=None, - title=("Container is the main container image to run in the sensor pod\n+optional"), - ) - image_pull_secrets: Optional[List[v1.LocalObjectReference]] = Field( - default=None, - alias="imagePullSecrets", - title=( - "ImagePullSecrets is an optional list of references to secrets in the same" - " namespace to use for pulling any of the images used by this PodSpec.\nIf" - " specified, these secrets will be passed to individual puller" - " implementations for them to use. For example,\nin the case of docker," - " only DockerConfig type secrets are honored.\nMore info:" - " https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod\n+optional\n+patchMergeKey=name\n+patchStrategy=merge" - ), - ) - metadata: Optional[Metadata] = Field( - default=None, - title="Metadata sets the pods's metadata, i.e. annotations and labels", - ) - node_selector: Optional[Dict[str, str]] = Field( - default=None, - alias="nodeSelector", - title=( - "NodeSelector is a selector which must be true for the pod to fit on a" - " node.\nSelector which must match a node's labels for the pod to be" - " scheduled on that node.\nMore info:" - " https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\n+optional" - ), - ) - priority: Optional[int] = Field( - default=None, - title=( - "The priority value. Various system components use this field to find" - " the\npriority of the EventSource pod. When Priority Admission Controller" - " is enabled,\nit prevents users from setting this field. The admission" - " controller populates\nthis field from PriorityClassName.\nThe higher the" - " value, the higher the priority.\nMore info:" - " https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/\n+optional" - ), - ) - priority_class_name: Optional[str] = Field( - default=None, - alias="priorityClassName", - title=( - "If specified, indicates the EventSource pod's priority." - ' "system-node-critical"\nand "system-cluster-critical" are two special' - " keywords which indicate the\nhighest priorities with the former being the" - " highest priority. Any other\nname must be defined by creating a" - " PriorityClass object with that name.\nIf not specified, the pod priority" - " will be default or zero if there is no\ndefault.\nMore info:" - " https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/\n+optional" - ), - ) - security_context: Optional[v1.PodSecurityContext] = Field( - default=None, - alias="securityContext", - title=( - "SecurityContext holds pod-level security attributes and common container" - " settings.\nOptional: Defaults to empty. See type description for default" - " values of each field.\n+optional" - ), - ) - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - title=( - "ServiceAccountName is the name of the ServiceAccount to use to run sensor" - " pod.\nMore info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\n+optional" - ), - ) - tolerations: Optional[List[v1.Toleration]] = Field( - default=None, title="If specified, the pod's tolerations.\n+optional" - ) - volumes: Optional[List[v1.Volume]] = Field( - default=None, - title=( - "Volumes is a list of volumes that can be mounted by containers in a" - " io.argoproj.workflow.v1alpha1.\n+patchStrategy=merge\n+patchMergeKey=name\n+optional" - ), - ) +class Trigger(BaseModel): + parameters: Annotated[ + Optional[List[TriggerParameter]], + Field(title=("Parameters is the list of parameters applied to the trigger template" " definition")), + ] = None + policy: Annotated[ + Optional[TriggerPolicy], + Field(title=("Policy to configure backoff and execution criteria for the" " trigger\n+optional")), + ] = None + rate_limit: Annotated[ + Optional[RateLimit], + Field(alias="rateLimit", title="Rate limit, default unit is Second\n+optional"), + ] = None + retry_strategy: Annotated[ + Optional[Backoff], + Field( + alias="retryStrategy", + title="Retry strategy, defaults to no retry\n+optional", + ), + ] = None + template: Annotated[ + Optional[TriggerTemplate], + Field(description="Template describes the trigger specification."), + ] = None -class Trigger(BaseModel): - parameters: Optional[List[TriggerParameter]] = Field( - default=None, - title=("Parameters is the list of parameters applied to the trigger template" " definition"), - ) - policy: Optional[TriggerPolicy] = Field( - default=None, - title=("Policy to configure backoff and execution criteria for the" " trigger\n+optional"), - ) - rate_limit: Optional[RateLimit] = Field( - default=None, - alias="rateLimit", - title="Rate limit, default unit is Second\n+optional", - ) - retry_strategy: Optional[Backoff] = Field( - default=None, - alias="retryStrategy", - title="Retry strategy, defaults to no retry\n+optional", - ) - template: Optional[TriggerTemplate] = Field( - default=None, description="Template describes the trigger specification." - ) +class Template(BaseModel): + affinity: Annotated[ + Optional[v1_1.Affinity], + Field(title="If specified, the pod's scheduling constraints\n+optional"), + ] = None + container: Annotated[ + Optional[v1_1.Container], + Field(title=("Container is the main container image to run in the sensor" " pod\n+optional")), + ] = None + image_pull_secrets: Annotated[ + Optional[List[v1_1.LocalObjectReference]], + Field( + alias="imagePullSecrets", + title=( + "ImagePullSecrets is an optional list of references to secrets in the" + " same namespace to use for pulling any of the images used by this" + " PodSpec.\nIf specified, these secrets will be passed to individual" + " puller implementations for them to use. For example,\nin the case of" + " docker, only DockerConfig type secrets are honored.\nMore info:" + " https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod\n+optional\n+patchMergeKey=name\n+patchStrategy=merge" + ), + ), + ] = None + metadata: Annotated[ + Optional[Metadata], + Field(title="Metadata sets the pods's metadata, i.e. annotations and labels"), + ] = None + node_selector: Annotated[ + Optional[Dict[str, str]], + Field( + alias="nodeSelector", + title=( + "NodeSelector is a selector which must be true for the pod to fit on a" + " node.\nSelector which must match a node's labels for the pod to be" + " scheduled on that node.\nMore info:" + " https://kubernetes.io/docs/concepts/configuration/assign-pod-node/\n+optional" + ), + ), + ] = None + priority: Annotated[ + Optional[int], + Field( + title=( + "The priority value. Various system components use this field to find" + " the\npriority of the EventSource pod. When Priority Admission" + " Controller is enabled,\nit prevents users from setting this field." + " The admission controller populates\nthis field from" + " PriorityClassName.\nThe higher the value, the higher the" + " priority.\nMore info:" + " https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/\n+optional" + ) + ), + ] = None + priority_class_name: Annotated[ + Optional[str], + Field( + alias="priorityClassName", + title=( + "If specified, indicates the EventSource pod's priority." + ' "system-node-critical"\nand "system-cluster-critical" are two special' + " keywords which indicate the\nhighest priorities with the former being" + " the highest priority. Any other\nname must be defined by creating a" + " PriorityClass object with that name.\nIf not specified, the pod" + " priority will be default or zero if there is no\ndefault.\nMore info:" + " https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/\n+optional" + ), + ), + ] = None + security_context: Annotated[ + Optional[v1_1.PodSecurityContext], + Field( + alias="securityContext", + title=( + "SecurityContext holds pod-level security attributes and common" + " container settings.\nOptional: Defaults to empty. See type" + " description for default values of each field.\n+optional" + ), + ), + ] = None + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + title=( + "ServiceAccountName is the name of the ServiceAccount to use to run" + " sensor pod.\nMore info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/\n+optional" + ), + ), + ] = None + tolerations: Annotated[ + Optional[List[v1_1.Toleration]], + Field(title="If specified, the pod's tolerations.\n+optional"), + ] = None + volumes: Annotated[ + Optional[List[v1_1.Volume]], + Field( + title=( + "Volumes is a list of volumes that can be mounted by containers in a" + " io.argoproj.workflow.v1alpha1.\n+patchStrategy=merge\n+patchMergeKey=name\n+optional" + ) + ), + ] = None class EventSourceSpec(BaseModel): - amqp: Optional[Dict[str, AMQPEventSource]] = Field(default=None, title="AMQP event sources") - azure_events_hub: Optional[Dict[str, AzureEventsHubEventSource]] = Field( - default=None, alias="azureEventsHub", title="AzureEventsHub event sources" - ) - bitbucket: Optional[Dict[str, BitbucketEventSource]] = Field(default=None, title="Bitbucket event sources") - bitbucketserver: Optional[Dict[str, BitbucketServerEventSource]] = Field( - default=None, title="Bitbucket Server event sources" - ) - calendar: Optional[Dict[str, CalendarEventSource]] = Field(default=None, title="Calendar event sources") - emitter: Optional[Dict[str, EmitterEventSource]] = Field(default=None, title="Emitter event source") - event_bus_name: Optional[str] = Field( - default=None, - alias="eventBusName", - title=("EventBusName references to a EventBus name. By default the value is" ' "default"'), - ) - file: Optional[Dict[str, FileEventSource]] = Field(default=None, title="File event sources") - generic: Optional[Dict[str, GenericEventSource]] = Field(default=None, title="Generic event source") - github: Optional[Dict[str, GithubEventSource]] = Field(default=None, title="Github event sources") - gitlab: Optional[Dict[str, GitlabEventSource]] = Field(default=None, title="Gitlab event sources") - hdfs: Optional[Dict[str, HDFSEventSource]] = Field(default=None, title="HDFS event sources") - kafka: Optional[Dict[str, KafkaEventSource]] = Field(default=None, title="Kafka event sources") - minio: Optional[Dict[str, S3Artifact]] = Field(default=None, title="Minio event sources") - mqtt: Optional[Dict[str, MQTTEventSource]] = Field(default=None, title="MQTT event sources") - nats: Optional[Dict[str, NATSEventsSource]] = Field(default=None, title="NATS event sources") - nsq: Optional[Dict[str, NSQEventSource]] = Field(default=None, title="NSQ event source") - pub_sub: Optional[Dict[str, PubSubEventSource]] = Field(default=None, alias="pubSub", title="PubSub event sources") - pulsar: Optional[Dict[str, PulsarEventSource]] = Field(default=None, title="Pulsar event source") - redis: Optional[Dict[str, RedisEventSource]] = Field(default=None, title="Redis event source") - redis_stream: Optional[Dict[str, RedisStreamEventSource]] = Field( - default=None, alias="redisStream", title="Redis stream source" - ) - replicas: Optional[int] = Field(default=None, title="Replicas is the event source deployment replicas") - resource: Optional[Dict[str, ResourceEventSource]] = Field(default=None, title="Resource event sources") - service: Optional[Service] = Field( - default=None, - title=("Service is the specifications of the service to expose the event" " source\n+optional"), - ) - slack: Optional[Dict[str, SlackEventSource]] = Field(default=None, title="Slack event sources") - sns: Optional[Dict[str, SNSEventSource]] = Field(default=None, title="SNS event sources") - sqs: Optional[Dict[str, SQSEventSource]] = Field(default=None, title="SQS event sources") - storage_grid: Optional[Dict[str, StorageGridEventSource]] = Field( - default=None, alias="storageGrid", title="StorageGrid event sources" - ) - stripe: Optional[Dict[str, StripeEventSource]] = Field(default=None, title="Stripe event sources") - template: Optional[Template] = Field( - default=None, - title="Template is the pod specification for the event source\n+optional", - ) - webhook: Optional[Dict[str, WebhookEventSource]] = Field(default=None, title="Webhook event sources") + amqp: Annotated[Optional[Dict[str, AMQPEventSource]], Field(title="AMQP event sources")] = None + azure_events_hub: Annotated[ + Optional[Dict[str, AzureEventsHubEventSource]], + Field(alias="azureEventsHub", title="AzureEventsHub event sources"), + ] = None + bitbucket: Annotated[ + Optional[Dict[str, BitbucketEventSource]], + Field(title="Bitbucket event sources"), + ] = None + bitbucketserver: Annotated[ + Optional[Dict[str, BitbucketServerEventSource]], + Field(title="Bitbucket Server event sources"), + ] = None + calendar: Annotated[Optional[Dict[str, CalendarEventSource]], Field(title="Calendar event sources")] = None + emitter: Annotated[Optional[Dict[str, EmitterEventSource]], Field(title="Emitter event source")] = None + event_bus_name: Annotated[ + Optional[str], + Field( + alias="eventBusName", + title=("EventBusName references to a EventBus name. By default the value is" ' "default"'), + ), + ] = None + file: Annotated[Optional[Dict[str, FileEventSource]], Field(title="File event sources")] = None + generic: Annotated[Optional[Dict[str, GenericEventSource]], Field(title="Generic event source")] = None + github: Annotated[Optional[Dict[str, GithubEventSource]], Field(title="Github event sources")] = None + gitlab: Annotated[Optional[Dict[str, GitlabEventSource]], Field(title="Gitlab event sources")] = None + hdfs: Annotated[Optional[Dict[str, HDFSEventSource]], Field(title="HDFS event sources")] = None + kafka: Annotated[Optional[Dict[str, KafkaEventSource]], Field(title="Kafka event sources")] = None + minio: Annotated[Optional[Dict[str, S3Artifact]], Field(title="Minio event sources")] = None + mqtt: Annotated[Optional[Dict[str, MQTTEventSource]], Field(title="MQTT event sources")] = None + nats: Annotated[Optional[Dict[str, NATSEventsSource]], Field(title="NATS event sources")] = None + nsq: Annotated[Optional[Dict[str, NSQEventSource]], Field(title="NSQ event source")] = None + pub_sub: Annotated[ + Optional[Dict[str, PubSubEventSource]], + Field(alias="pubSub", title="PubSub event sources"), + ] = None + pulsar: Annotated[Optional[Dict[str, PulsarEventSource]], Field(title="Pulsar event source")] = None + redis: Annotated[Optional[Dict[str, RedisEventSource]], Field(title="Redis event source")] = None + redis_stream: Annotated[ + Optional[Dict[str, RedisStreamEventSource]], + Field(alias="redisStream", title="Redis stream source"), + ] = None + replicas: Annotated[Optional[int], Field(title="Replicas is the event source deployment replicas")] = None + resource: Annotated[Optional[Dict[str, ResourceEventSource]], Field(title="Resource event sources")] = None + service: Annotated[ + Optional[Service], + Field(title=("Service is the specifications of the service to expose the event" " source\n+optional")), + ] = None + slack: Annotated[Optional[Dict[str, SlackEventSource]], Field(title="Slack event sources")] = None + sns: Annotated[Optional[Dict[str, SNSEventSource]], Field(title="SNS event sources")] = None + sqs: Annotated[Optional[Dict[str, SQSEventSource]], Field(title="SQS event sources")] = None + storage_grid: Annotated[ + Optional[Dict[str, StorageGridEventSource]], + Field(alias="storageGrid", title="StorageGrid event sources"), + ] = None + stripe: Annotated[Optional[Dict[str, StripeEventSource]], Field(title="Stripe event sources")] = None + template: Annotated[ + Optional[Template], + Field(title="Template is the pod specification for the event source\n+optional"), + ] = None + webhook: Annotated[Optional[Dict[str, WebhookEventSource]], Field(title="Webhook event sources")] = None class SensorSpec(BaseModel): - dependencies: Optional[List[EventDependency]] = Field( - default=None, - description=("Dependencies is a list of the events that this sensor is dependent on."), - ) - error_on_failed_round: Optional[bool] = Field( - default=None, - alias="errorOnFailedRound", - description=( - "ErrorOnFailedRound if set to true, marks sensor state as `error` if the" - " previous trigger round fails.\nOnce sensor state is set to `error`, no" - " further triggers will be processed." - ), - ) - event_bus_name: Optional[str] = Field( - default=None, - alias="eventBusName", - title=("EventBusName references to a EventBus name. By default the value is" ' "default"'), - ) - replicas: Optional[int] = Field(default=None, title="Replicas is the sensor deployment replicas") - template: Optional[Template] = Field( - default=None, - title="Template is the pod specification for the sensor\n+optional", - ) - triggers: Optional[List[Trigger]] = Field( - default=None, - description=( - "Triggers is a list of the things that this sensor evokes. These are the" " outputs from this sensor." - ), - ) + dependencies: Annotated[ + Optional[List[EventDependency]], + Field(description=("Dependencies is a list of the events that this sensor is dependent on.")), + ] = None + error_on_failed_round: Annotated[ + Optional[bool], + Field( + alias="errorOnFailedRound", + description=( + "ErrorOnFailedRound if set to true, marks sensor state as `error` if" + " the previous trigger round fails.\nOnce sensor state is set to" + " `error`, no further triggers will be processed." + ), + ), + ] = None + event_bus_name: Annotated[ + Optional[str], + Field( + alias="eventBusName", + title=("EventBusName references to a EventBus name. By default the value is" ' "default"'), + ), + ] = None + replicas: Annotated[Optional[int], Field(title="Replicas is the sensor deployment replicas")] = None + template: Annotated[ + Optional[Template], + Field(title="Template is the pod specification for the sensor\n+optional"), + ] = None + triggers: Annotated[ + Optional[List[Trigger]], + Field( + description=( + "Triggers is a list of the things that this sensor evokes. These are" " the outputs from this sensor." + ) + ), + ] = None class EventSource(BaseModel): - metadata: Optional[v1_1.ObjectMeta] = None + metadata: Optional[v1.ObjectMeta] = None spec: Optional[EventSourceSpec] = None - status: Optional[EventSourceStatus] = Field(default=None, title="+optional") - - -class EventSourceList(BaseModel): - items: Optional[List[EventSource]] = None - metadata: Optional[v1_1.ListMeta] = None + status: Annotated[Optional[EventSourceStatus], Field(title="+optional")] = None class Sensor(BaseModel): - metadata: Optional[v1_1.ObjectMeta] = None + metadata: Optional[v1.ObjectMeta] = None spec: Optional[SensorSpec] = None - status: Optional[SensorStatus] = Field(default=None, title="+optional") + status: Annotated[Optional[SensorStatus], Field(title="+optional")] = None + + +class EventSourceList(BaseModel): + items: Optional[List[EventSource]] = None + metadata: Optional[v1.ListMeta] = None class SensorList(BaseModel): items: Optional[List[Sensor]] = None - metadata: Optional[v1_1.ListMeta] = None + metadata: Optional[v1.ListMeta] = None diff --git a/src/hera/workflows/models/io/argoproj/events/v1alpha1.pyi b/src/hera/workflows/models/io/argoproj/events/v1alpha1.pyi deleted file mode 100644 index e0192ca9b..000000000 --- a/src/hera/workflows/models/io/argoproj/events/v1alpha1.pyi +++ /dev/null @@ -1,810 +0,0 @@ -from typing import Dict, List, Optional - -from hera.shared._pydantic import ( - BaseModel as BaseModel, - Field as Field, -) - -from ...k8s.api.core import v1 as v1 -from ...k8s.apimachinery.pkg.apis.meta import v1 as v1_1 - -class AMQPConsumeConfig(BaseModel): - auto_ack: Optional[bool] - consumer_tag: Optional[str] - exclusive: Optional[bool] - no_local: Optional[bool] - no_wait: Optional[bool] - -class AMQPExchangeDeclareConfig(BaseModel): - auto_delete: Optional[bool] - durable: Optional[bool] - internal: Optional[bool] - no_wait: Optional[bool] - -class AMQPQueueBindConfig(BaseModel): - no_wait: Optional[bool] - -class AMQPQueueDeclareConfig(BaseModel): - arguments: Optional[str] - auto_delete: Optional[bool] - durable: Optional[bool] - exclusive: Optional[bool] - name: Optional[str] - no_wait: Optional[bool] - -class Amount(BaseModel): - value: Optional[str] - -class BitbucketRepository(BaseModel): - owner: Optional[str] - repository_slug: Optional[str] - -class BitbucketServerRepository(BaseModel): - project_key: Optional[str] - repository_slug: Optional[str] - -class CatchupConfiguration(BaseModel): - enabled: Optional[bool] - max_duration: Optional[str] - -class ConditionsResetByTime(BaseModel): - cron: Optional[str] - timezone: Optional[str] - -class ConditionsResetCriteria(BaseModel): - by_time: Optional[ConditionsResetByTime] - -class ConfigMapPersistence(BaseModel): - create_if_not_exist: Optional[bool] - name: Optional[str] - -class DataFilter(BaseModel): - comparator: Optional[str] - path: Optional[str] - template: Optional[str] - type: Optional[str] - value: Optional[List[str]] - -class EventDependencyTransformer(BaseModel): - jq: Optional[str] - script: Optional[str] - -class EventPersistence(BaseModel): - catchup: Optional[CatchupConfiguration] - config_map: Optional[ConfigMapPersistence] - -class EventSourceFilter(BaseModel): - expression: Optional[str] - -class FileArtifact(BaseModel): - path: Optional[str] - -class GitRemoteConfig(BaseModel): - name: Optional[str] - urls: Optional[List[str]] - -class Int64OrString(BaseModel): - int64_val: Optional[str] - str_val: Optional[str] - type: Optional[str] - -class KafkaConsumerGroup(BaseModel): - group_name: Optional[str] - oldest: Optional[bool] - rebalance_strategy: Optional[str] - -class LogTrigger(BaseModel): - interval_seconds: Optional[str] - -class Metadata(BaseModel): - annotations: Optional[Dict[str, str]] - labels: Optional[Dict[str, str]] - -class OwnedRepositories(BaseModel): - names: Optional[List[str]] - owner: Optional[str] - -class PayloadField(BaseModel): - name: Optional[str] - path: Optional[str] - -class RateLimit(BaseModel): - requests_per_unit: Optional[int] - unit: Optional[str] - -class Resource(BaseModel): - value: Optional[str] - -class S3Bucket(BaseModel): - key: Optional[str] - name: Optional[str] - -class S3Filter(BaseModel): - prefix: Optional[str] - suffix: Optional[str] - -class Selector(BaseModel): - key: Optional[str] - operation: Optional[str] - value: Optional[str] - -class StatusPolicy(BaseModel): - allow: Optional[List[int]] - -class StorageGridFilter(BaseModel): - prefix: Optional[str] - suffix: Optional[str] - -class TimeFilter(BaseModel): - start: Optional[str] - stop: Optional[str] - -class TriggerParameterSource(BaseModel): - context_key: Optional[str] - context_template: Optional[str] - data_key: Optional[str] - data_template: Optional[str] - dependency_name: Optional[str] - value: Optional[str] - -class URLArtifact(BaseModel): - path: Optional[str] - verify_cert: Optional[bool] - -class WatchPathConfig(BaseModel): - directory: Optional[str] - path: Optional[str] - path_regexp: Optional[str] - -class AzureEventsHubEventSource(BaseModel): - filter: Optional[EventSourceFilter] - fqdn: Optional[str] - hub_name: Optional[str] - metadata: Optional[Dict[str, str]] - shared_access_key: Optional[v1.SecretKeySelector] - shared_access_key_name: Optional[v1.SecretKeySelector] - -class Backoff(BaseModel): - duration: Optional[Int64OrString] - factor: Optional[Amount] - jitter: Optional[Amount] - steps: Optional[int] - -class BasicAuth(BaseModel): - password: Optional[v1.SecretKeySelector] - username: Optional[v1.SecretKeySelector] - -class BitbucketBasicAuth(BaseModel): - password: Optional[v1.SecretKeySelector] - username: Optional[v1.SecretKeySelector] - -class CalendarEventSource(BaseModel): - exclusion_dates: Optional[List[str]] - filter: Optional[EventSourceFilter] - interval: Optional[str] - metadata: Optional[Dict[str, str]] - persistence: Optional[EventPersistence] - schedule: Optional[str] - timezone: Optional[str] - -class Condition(BaseModel): - last_transition_time: Optional[v1_1.Time] - message: Optional[str] - reason: Optional[str] - status: Optional[str] - type: Optional[str] - -class EventContext(BaseModel): - datacontenttype: Optional[str] - id: Optional[str] - source: Optional[str] - specversion: Optional[str] - subject: Optional[str] - time: Optional[v1_1.Time] - type: Optional[str] - -class ExprFilter(BaseModel): - expr: Optional[str] - fields: Optional[List[PayloadField]] - -class FileEventSource(BaseModel): - event_type: Optional[str] - filter: Optional[EventSourceFilter] - metadata: Optional[Dict[str, str]] - polling: Optional[bool] - watch_path_config: Optional[WatchPathConfig] - -class GenericEventSource(BaseModel): - auth_secret: Optional[v1.SecretKeySelector] - config: Optional[str] - filter: Optional[EventSourceFilter] - insecure: Optional[bool] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - url: Optional[str] - -class GitCreds(BaseModel): - password: Optional[v1.SecretKeySelector] - username: Optional[v1.SecretKeySelector] - -class GithubAppCreds(BaseModel): - app_id: Optional[str] - installation_id: Optional[str] - private_key: Optional[v1.SecretKeySelector] - -class HDFSEventSource(BaseModel): - addresses: Optional[List[str]] - check_interval: Optional[str] - filter: Optional[EventSourceFilter] - hdfs_user: Optional[str] - krb_c_cache_secret: Optional[v1.SecretKeySelector] - krb_config_config_map: Optional[v1.ConfigMapKeySelector] - krb_keytab_secret: Optional[v1.SecretKeySelector] - krb_realm: Optional[str] - krb_service_principal_name: Optional[str] - krb_username: Optional[str] - metadata: Optional[Dict[str, str]] - type: Optional[str] - watch_path_config: Optional[WatchPathConfig] - -class K8SResourcePolicy(BaseModel): - backoff: Optional[Backoff] - error_on_backoff_timeout: Optional[bool] - labels: Optional[Dict[str, str]] - -class NATSAuth(BaseModel): - basic: Optional[BasicAuth] - credential: Optional[v1.SecretKeySelector] - nkey: Optional[v1.SecretKeySelector] - token: Optional[v1.SecretKeySelector] - -class PubSubEventSource(BaseModel): - credential_secret: Optional[v1.SecretKeySelector] - delete_subscription_on_finish: Optional[bool] - filter: Optional[EventSourceFilter] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - project_id: Optional[str] - subscription_id: Optional[str] - topic: Optional[str] - topic_project_id: Optional[str] - -class ResourceFilter(BaseModel): - after_start: Optional[bool] - created_by: Optional[v1_1.Time] - fields: Optional[List[Selector]] - labels: Optional[List[Selector]] - prefix: Optional[str] - -class S3Artifact(BaseModel): - access_key: Optional[v1.SecretKeySelector] - bucket: Optional[S3Bucket] - endpoint: Optional[str] - events: Optional[List[str]] - filter: Optional[S3Filter] - insecure: Optional[bool] - metadata: Optional[Dict[str, str]] - region: Optional[str] - secret_key: Optional[v1.SecretKeySelector] - -class SASLConfig(BaseModel): - mechanism: Optional[str] - password: Optional[v1.SecretKeySelector] - user: Optional[v1.SecretKeySelector] - -class SQSEventSource(BaseModel): - access_key: Optional[v1.SecretKeySelector] - dlq: Optional[bool] - endpoint: Optional[str] - filter: Optional[EventSourceFilter] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - queue: Optional[str] - queue_account_id: Optional[str] - region: Optional[str] - role_arn: Optional[str] - secret_key: Optional[v1.SecretKeySelector] - session_token: Optional[v1.SecretKeySelector] - wait_time_seconds: Optional[str] - -class Status(BaseModel): - conditions: Optional[List[Condition]] - -class TLSConfig(BaseModel): - ca_cert_secret: Optional[v1.SecretKeySelector] - client_cert_secret: Optional[v1.SecretKeySelector] - client_key_secret: Optional[v1.SecretKeySelector] - insecure_skip_verify: Optional[bool] - -class TriggerParameter(BaseModel): - dest: Optional[str] - operation: Optional[str] - src: Optional[TriggerParameterSource] - -class TriggerPolicy(BaseModel): - k8s: Optional[K8SResourcePolicy] - status: Optional[StatusPolicy] - -class ValueFromSource(BaseModel): - config_map_key_ref: Optional[v1.ConfigMapKeySelector] - secret_key_ref: Optional[v1.SecretKeySelector] - -class WebhookContext(BaseModel): - auth_secret: Optional[v1.SecretKeySelector] - endpoint: Optional[str] - max_payload_size: Optional[str] - metadata: Optional[Dict[str, str]] - method: Optional[str] - port: Optional[str] - server_cert_secret: Optional[v1.SecretKeySelector] - server_key_secret: Optional[v1.SecretKeySelector] - url: Optional[str] - -class WebhookEventSource(BaseModel): - filter: Optional[EventSourceFilter] - webhook_context: Optional[WebhookContext] - -class AMQPEventSource(BaseModel): - auth: Optional[BasicAuth] - connection_backoff: Optional[Backoff] - consume: Optional[AMQPConsumeConfig] - exchange_declare: Optional[AMQPExchangeDeclareConfig] - exchange_name: Optional[str] - exchange_type: Optional[str] - filter: Optional[EventSourceFilter] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - queue_bind: Optional[AMQPQueueBindConfig] - queue_declare: Optional[AMQPQueueDeclareConfig] - routing_key: Optional[str] - tls: Optional[TLSConfig] - url: Optional[str] - url_secret: Optional[v1.SecretKeySelector] - -class AWSLambdaTrigger(BaseModel): - access_key: Optional[v1.SecretKeySelector] - function_name: Optional[str] - invocation_type: Optional[str] - parameters: Optional[List[TriggerParameter]] - payload: Optional[List[TriggerParameter]] - region: Optional[str] - role_arn: Optional[str] - secret_key: Optional[v1.SecretKeySelector] - -class AzureEventHubsTrigger(BaseModel): - fqdn: Optional[str] - hub_name: Optional[str] - parameters: Optional[List[TriggerParameter]] - payload: Optional[List[TriggerParameter]] - shared_access_key: Optional[v1.SecretKeySelector] - shared_access_key_name: Optional[v1.SecretKeySelector] - -class BitbucketAuth(BaseModel): - basic: Optional[BitbucketBasicAuth] - oauth_token: Optional[v1.SecretKeySelector] - -class BitbucketEventSource(BaseModel): - auth: Optional[BitbucketAuth] - delete_hook_on_finish: Optional[bool] - events: Optional[List[str]] - filter: Optional[EventSourceFilter] - metadata: Optional[Dict[str, str]] - owner: Optional[str] - project_key: Optional[str] - repositories: Optional[List[BitbucketRepository]] - repository_slug: Optional[str] - webhook: Optional[WebhookContext] - -class BitbucketServerEventSource(BaseModel): - access_token: Optional[v1.SecretKeySelector] - bitbucketserver_base_url: Optional[str] - delete_hook_on_finish: Optional[bool] - events: Optional[List[str]] - filter: Optional[EventSourceFilter] - metadata: Optional[Dict[str, str]] - project_key: Optional[str] - repositories: Optional[List[BitbucketServerRepository]] - repository_slug: Optional[str] - webhook: Optional[WebhookContext] - webhook_secret: Optional[v1.SecretKeySelector] - -class CustomTrigger(BaseModel): - cert_secret: Optional[v1.SecretKeySelector] - parameters: Optional[List[TriggerParameter]] - payload: Optional[List[TriggerParameter]] - secure: Optional[bool] - server_name_override: Optional[str] - server_url: Optional[str] - spec: Optional[Dict[str, str]] - -class EmitterEventSource(BaseModel): - broker: Optional[str] - channel_key: Optional[str] - channel_name: Optional[str] - connection_backoff: Optional[Backoff] - filter: Optional[EventSourceFilter] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - password: Optional[v1.SecretKeySelector] - tls: Optional[TLSConfig] - username: Optional[v1.SecretKeySelector] - -class EventDependencyFilter(BaseModel): - context: Optional[EventContext] - data: Optional[List[DataFilter]] - data_logical_operator: Optional[str] - expr_logical_operator: Optional[str] - exprs: Optional[List[ExprFilter]] - script: Optional[str] - time: Optional[TimeFilter] - -class EventSourceStatus(BaseModel): - status: Optional[Status] - -class GitArtifact(BaseModel): - branch: Optional[str] - clone_directory: Optional[str] - creds: Optional[GitCreds] - file_path: Optional[str] - insecure_ignore_host_key: Optional[bool] - ref: Optional[str] - remote: Optional[GitRemoteConfig] - ssh_key_secret: Optional[v1.SecretKeySelector] - tag: Optional[str] - url: Optional[str] - -class GithubEventSource(BaseModel): - active: Optional[bool] - api_token: Optional[v1.SecretKeySelector] - content_type: Optional[str] - delete_hook_on_finish: Optional[bool] - events: Optional[List[str]] - filter: Optional[EventSourceFilter] - github_app: Optional[GithubAppCreds] - github_base_url: Optional[str] - github_upload_url: Optional[str] - id: Optional[str] - insecure: Optional[bool] - metadata: Optional[Dict[str, str]] - organizations: Optional[List[str]] - owner: Optional[str] - repositories: Optional[List[OwnedRepositories]] - repository: Optional[str] - webhook: Optional[WebhookContext] - webhook_secret: Optional[v1.SecretKeySelector] - -class GitlabEventSource(BaseModel): - access_token: Optional[v1.SecretKeySelector] - delete_hook_on_finish: Optional[bool] - enable_ssl_verification: Optional[bool] - events: Optional[List[str]] - filter: Optional[EventSourceFilter] - gitlab_base_url: Optional[str] - metadata: Optional[Dict[str, str]] - project_id: Optional[str] - projects: Optional[List[str]] - secret_token: Optional[v1.SecretKeySelector] - webhook: Optional[WebhookContext] - -class KafkaEventSource(BaseModel): - config: Optional[str] - connection_backoff: Optional[Backoff] - consumer_group: Optional[KafkaConsumerGroup] - filter: Optional[EventSourceFilter] - json_body: Optional[bool] - limit_events_per_second: Optional[str] - metadata: Optional[Dict[str, str]] - partition: Optional[str] - sasl: Optional[SASLConfig] - tls: Optional[TLSConfig] - topic: Optional[str] - url: Optional[str] - version: Optional[str] - -class KafkaTrigger(BaseModel): - compress: Optional[bool] - flush_frequency: Optional[int] - parameters: Optional[List[TriggerParameter]] - partition: Optional[int] - partitioning_key: Optional[str] - payload: Optional[List[TriggerParameter]] - required_acks: Optional[int] - sasl: Optional[SASLConfig] - tls: Optional[TLSConfig] - topic: Optional[str] - url: Optional[str] - version: Optional[str] - -class MQTTEventSource(BaseModel): - client_id: Optional[str] - connection_backoff: Optional[Backoff] - filter: Optional[EventSourceFilter] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - tls: Optional[TLSConfig] - topic: Optional[str] - url: Optional[str] - -class NATSEventsSource(BaseModel): - auth: Optional[NATSAuth] - connection_backoff: Optional[Backoff] - filter: Optional[EventSourceFilter] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - subject: Optional[str] - tls: Optional[TLSConfig] - url: Optional[str] - -class NATSTrigger(BaseModel): - parameters: Optional[List[TriggerParameter]] - payload: Optional[List[TriggerParameter]] - subject: Optional[str] - tls: Optional[TLSConfig] - url: Optional[str] - -class NSQEventSource(BaseModel): - channel: Optional[str] - connection_backoff: Optional[Backoff] - filter: Optional[EventSourceFilter] - host_address: Optional[str] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - tls: Optional[TLSConfig] - topic: Optional[str] - -class OpenWhiskTrigger(BaseModel): - action_name: Optional[str] - auth_token: Optional[v1.SecretKeySelector] - host: Optional[str] - namespace: Optional[str] - parameters: Optional[List[TriggerParameter]] - payload: Optional[List[TriggerParameter]] - version: Optional[str] - -class PulsarEventSource(BaseModel): - auth_token_secret: Optional[v1.SecretKeySelector] - connection_backoff: Optional[Backoff] - filter: Optional[EventSourceFilter] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - tls: Optional[TLSConfig] - tls_allow_insecure_connection: Optional[bool] - tls_trust_certs_secret: Optional[v1.SecretKeySelector] - tls_validate_hostname: Optional[bool] - topics: Optional[List[str]] - type: Optional[str] - url: Optional[str] - -class PulsarTrigger(BaseModel): - auth_token_secret: Optional[v1.SecretKeySelector] - connection_backoff: Optional[Backoff] - parameters: Optional[List[TriggerParameter]] - payload: Optional[List[TriggerParameter]] - tls: Optional[TLSConfig] - tls_allow_insecure_connection: Optional[bool] - tls_trust_certs_secret: Optional[v1.SecretKeySelector] - tls_validate_hostname: Optional[bool] - topic: Optional[str] - url: Optional[str] - -class RedisEventSource(BaseModel): - channels: Optional[List[str]] - db: Optional[int] - filter: Optional[EventSourceFilter] - host_address: Optional[str] - json_body: Optional[bool] - metadata: Optional[Dict[str, str]] - namespace: Optional[str] - password: Optional[v1.SecretKeySelector] - tls: Optional[TLSConfig] - username: Optional[str] - -class RedisStreamEventSource(BaseModel): - consumer_group: Optional[str] - db: Optional[int] - filter: Optional[EventSourceFilter] - host_address: Optional[str] - max_msg_count_per_read: Optional[int] - metadata: Optional[Dict[str, str]] - password: Optional[v1.SecretKeySelector] - streams: Optional[List[str]] - tls: Optional[TLSConfig] - username: Optional[str] - -class ResourceEventSource(BaseModel): - event_types: Optional[List[str]] - filter: Optional[ResourceFilter] - group_version_resource: Optional[v1_1.GroupVersionResource] - metadata: Optional[Dict[str, str]] - namespace: Optional[str] - -class SNSEventSource(BaseModel): - access_key: Optional[v1.SecretKeySelector] - endpoint: Optional[str] - filter: Optional[EventSourceFilter] - metadata: Optional[Dict[str, str]] - region: Optional[str] - role_arn: Optional[str] - secret_key: Optional[v1.SecretKeySelector] - topic_arn: Optional[str] - validate_signature: Optional[bool] - webhook: Optional[WebhookContext] - -class SecureHeader(BaseModel): - name: Optional[str] - value_from: Optional[ValueFromSource] - -class SensorStatus(BaseModel): - status: Optional[Status] - -class Service(BaseModel): - cluster_ip: Optional[str] - ports: Optional[List[v1.ServicePort]] - -class SlackEventSource(BaseModel): - filter: Optional[EventSourceFilter] - metadata: Optional[Dict[str, str]] - signing_secret: Optional[v1.SecretKeySelector] - token: Optional[v1.SecretKeySelector] - webhook: Optional[WebhookContext] - -class SlackTrigger(BaseModel): - channel: Optional[str] - message: Optional[str] - parameters: Optional[List[TriggerParameter]] - slack_token: Optional[v1.SecretKeySelector] - -class StorageGridEventSource(BaseModel): - api_url: Optional[str] - auth_token: Optional[v1.SecretKeySelector] - bucket: Optional[str] - events: Optional[List[str]] - filter: Optional[StorageGridFilter] - metadata: Optional[Dict[str, str]] - region: Optional[str] - topic_arn: Optional[str] - webhook: Optional[WebhookContext] - -class StripeEventSource(BaseModel): - api_key: Optional[v1.SecretKeySelector] - create_webhook: Optional[bool] - event_filter: Optional[List[str]] - metadata: Optional[Dict[str, str]] - webhook: Optional[WebhookContext] - -class ArtifactLocation(BaseModel): - configmap: Optional[v1.ConfigMapKeySelector] - file: Optional[FileArtifact] - git: Optional[GitArtifact] - inline: Optional[str] - resource: Optional[Resource] - s3: Optional[S3Artifact] - url: Optional[URLArtifact] - -class EventDependency(BaseModel): - event_name: Optional[str] - event_source_name: Optional[str] - filters: Optional[EventDependencyFilter] - filters_logical_operator: Optional[str] - name: Optional[str] - transform: Optional[EventDependencyTransformer] - -class HTTPTrigger(BaseModel): - basic_auth: Optional[BasicAuth] - headers: Optional[Dict[str, str]] - method: Optional[str] - parameters: Optional[List[TriggerParameter]] - payload: Optional[List[TriggerParameter]] - secure_headers: Optional[List[SecureHeader]] - timeout: Optional[str] - tls: Optional[TLSConfig] - url: Optional[str] - -class StandardK8STrigger(BaseModel): - live_object: Optional[bool] - operation: Optional[str] - parameters: Optional[List[TriggerParameter]] - patch_strategy: Optional[str] - source: Optional[ArtifactLocation] - -class ArgoWorkflowTrigger(BaseModel): - args: Optional[List[str]] - operation: Optional[str] - parameters: Optional[List[TriggerParameter]] - source: Optional[ArtifactLocation] - -class TriggerTemplate(BaseModel): - argo_workflow: Optional[ArgoWorkflowTrigger] - aws_lambda: Optional[AWSLambdaTrigger] - azure_event_hubs: Optional[AzureEventHubsTrigger] - conditions: Optional[str] - conditions_reset: Optional[List[ConditionsResetCriteria]] - custom: Optional[CustomTrigger] - http: Optional[HTTPTrigger] - k8s: Optional[StandardK8STrigger] - kafka: Optional[KafkaTrigger] - log: Optional[LogTrigger] - name: Optional[str] - nats: Optional[NATSTrigger] - open_whisk: Optional[OpenWhiskTrigger] - pulsar: Optional[PulsarTrigger] - slack: Optional[SlackTrigger] - -class Template(BaseModel): - affinity: Optional[v1.Affinity] - container: Optional[v1.Container] - image_pull_secrets: Optional[List[v1.LocalObjectReference]] - metadata: Optional[Metadata] - node_selector: Optional[Dict[str, str]] - priority: Optional[int] - priority_class_name: Optional[str] - security_context: Optional[v1.PodSecurityContext] - service_account_name: Optional[str] - tolerations: Optional[List[v1.Toleration]] - volumes: Optional[List[v1.Volume]] - -class Trigger(BaseModel): - parameters: Optional[List[TriggerParameter]] - policy: Optional[TriggerPolicy] - rate_limit: Optional[RateLimit] - retry_strategy: Optional[Backoff] - template: Optional[TriggerTemplate] - -class EventSourceSpec(BaseModel): - amqp: Optional[Dict[str, AMQPEventSource]] - azure_events_hub: Optional[Dict[str, AzureEventsHubEventSource]] - bitbucket: Optional[Dict[str, BitbucketEventSource]] - bitbucketserver: Optional[Dict[str, BitbucketServerEventSource]] - calendar: Optional[Dict[str, CalendarEventSource]] - emitter: Optional[Dict[str, EmitterEventSource]] - event_bus_name: Optional[str] - file: Optional[Dict[str, FileEventSource]] - generic: Optional[Dict[str, GenericEventSource]] - github: Optional[Dict[str, GithubEventSource]] - gitlab: Optional[Dict[str, GitlabEventSource]] - hdfs: Optional[Dict[str, HDFSEventSource]] - kafka: Optional[Dict[str, KafkaEventSource]] - minio: Optional[Dict[str, S3Artifact]] - mqtt: Optional[Dict[str, MQTTEventSource]] - nats: Optional[Dict[str, NATSEventsSource]] - nsq: Optional[Dict[str, NSQEventSource]] - pub_sub: Optional[Dict[str, PubSubEventSource]] - pulsar: Optional[Dict[str, PulsarEventSource]] - redis: Optional[Dict[str, RedisEventSource]] - redis_stream: Optional[Dict[str, RedisStreamEventSource]] - replicas: Optional[int] - resource: Optional[Dict[str, ResourceEventSource]] - service: Optional[Service] - slack: Optional[Dict[str, SlackEventSource]] - sns: Optional[Dict[str, SNSEventSource]] - sqs: Optional[Dict[str, SQSEventSource]] - storage_grid: Optional[Dict[str, StorageGridEventSource]] - stripe: Optional[Dict[str, StripeEventSource]] - template: Optional[Template] - webhook: Optional[Dict[str, WebhookEventSource]] - -class SensorSpec(BaseModel): - dependencies: Optional[List[EventDependency]] - error_on_failed_round: Optional[bool] - event_bus_name: Optional[str] - replicas: Optional[int] - template: Optional[Template] - triggers: Optional[List[Trigger]] - -class EventSource(BaseModel): - metadata: Optional[v1_1.ObjectMeta] - spec: Optional[EventSourceSpec] - status: Optional[EventSourceStatus] - -class EventSourceList(BaseModel): - items: Optional[List[EventSource]] - metadata: Optional[v1_1.ListMeta] - -class Sensor(BaseModel): - metadata: Optional[v1_1.ObjectMeta] - spec: Optional[SensorSpec] - status: Optional[SensorStatus] - -class SensorList(BaseModel): - items: Optional[List[Sensor]] - metadata: Optional[v1_1.ListMeta] diff --git a/src/hera/workflows/models/io/argoproj/workflow/v1alpha1.py b/src/hera/workflows/models/io/argoproj/workflow/v1alpha1.py index f3d46ad52..6d0a2c828 100644 --- a/src/hera/workflows/models/io/argoproj/workflow/v1alpha1.py +++ b/src/hera/workflows/models/io/argoproj/workflow/v1alpha1.py @@ -5,6 +5,8 @@ from typing import Any, Dict, List, Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from ...k8s.api.core import v1 @@ -14,7 +16,28 @@ class Amount(BaseModel): - __root__: float = Field(..., description="Amount represent a numeric amount.") + __root__: Annotated[float, Field(description="Amount represent a numeric amount.")] + + +class NoneStrategy(BaseModel): + pass + + +class TarStrategy(BaseModel): + compression_level: Annotated[ + Optional[int], + Field( + alias="compressionLevel", + description=( + "CompressionLevel specifies the gzip compression level to use for the" + " artifact. Defaults to gzip.DefaultCompression." + ), + ), + ] = None + + +class ZipStrategy(BaseModel): + pass class ArchivedWorkflowDeletedResponse(BaseModel): @@ -22,59 +45,83 @@ class ArchivedWorkflowDeletedResponse(BaseModel): class ArtGCStatus(BaseModel): - not_specified: Optional[bool] = Field( - default=None, - alias="notSpecified", - description=("if this is true, we already checked to see if we need to do it and we" " don't"), - ) - pods_recouped: Optional[Dict[str, bool]] = Field( - default=None, - alias="podsRecouped", - description=( - "have completed Pods been processed? (mapped by Pod name) used to prevent" - " re-processing the Status of a Pod more than once" - ), - ) - strategies_processed: Optional[Dict[str, bool]] = Field( - default=None, - alias="strategiesProcessed", - description=( - "have Pods been started to perform this strategy? (enables us not to" - " re-process what we've already done)" - ), - ) + not_specified: Annotated[ + Optional[bool], + Field( + alias="notSpecified", + description=("if this is true, we already checked to see if we need to do it and we" " don't"), + ), + ] = None + pods_recouped: Annotated[ + Optional[Dict[str, bool]], + Field( + alias="podsRecouped", + description=( + "have completed Pods been processed? (mapped by Pod name) used to" + " prevent re-processing the Status of a Pod more than once" + ), + ), + ] = None + strategies_processed: Annotated[ + Optional[Dict[str, bool]], + Field( + alias="strategiesProcessed", + description=( + "have Pods been started to perform this strategy? (enables us not to" + " re-process what we've already done)" + ), + ), + ] = None + + +class RawArtifact(BaseModel): + data: Annotated[str, Field(description="Data is the string contents of the artifact")] + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None class ArtifactRepositoryRef(BaseModel): - config_map: Optional[str] = Field( - default=None, - alias="configMap", - description='The name of the config map. Defaults to "artifact-repositories".', - ) - key: Optional[str] = Field( - default=None, - description=( - "The config map key. Defaults to the value of the" - ' "workflows.argoproj.io/default-artifact-repository" annotation.' + config_map: Annotated[ + Optional[str], + Field( + alias="configMap", + description=('The name of the config map. Defaults to "artifact-repositories".'), + ), + ] = None + key: Annotated[ + Optional[str], + Field( + description=( + "The config map key. Defaults to the value of the" + ' "workflows.argoproj.io/default-artifact-repository" annotation.' + ) ), - ) + ] = None class ArtifactResult(BaseModel): - error: Optional[str] = Field( - default=None, - description=("Error is an optional error message which should be set if Success==false"), - ) - name: str = Field(..., description="Name is the name of the Artifact") - success: Optional[bool] = Field(default=None, description="Success describes whether the deletion succeeded") + error: Annotated[ + Optional[str], + Field(description=("Error is an optional error message which should be set if" " Success==false")), + ] = None + name: Annotated[str, Field(description="Name is the name of the Artifact")] + success: Annotated[ + Optional[bool], + Field(description="Success describes whether the deletion succeeded"), + ] = None class ArtifactResultNodeStatus(BaseModel): - artifact_results: Optional[Dict[str, ArtifactResult]] = Field( - default=None, - alias="artifactResults", - description="ArtifactResults maps Artifact name to result of the deletion", - ) + artifact_results: Annotated[ + Optional[Dict[str, ArtifactResult]], + Field( + alias="artifactResults", + description="ArtifactResults maps Artifact name to result of the deletion", + ), + ] = None class ClusterWorkflowTemplateDeleteResponse(BaseModel): @@ -90,9 +137,9 @@ class CollectEventResponse(BaseModel): class Condition(BaseModel): - message: Optional[str] = Field(default=None, description="Message is the condition message") - status: Optional[str] = Field(default=None, description="Status is the status of the condition") - type: Optional[str] = Field(default=None, description="Type is the type of condition") + message: Annotated[Optional[str], Field(description="Message is the condition message")] = None + status: Annotated[Optional[str], Field(description="Status is the status of the condition")] = None + type: Annotated[Optional[str], Field(description="Type is the type of condition")] = None class ContinueOn(BaseModel): @@ -101,15 +148,14 @@ class ContinueOn(BaseModel): class Counter(BaseModel): - value: str = Field(..., description="Value is the value of the metric") + value: Annotated[str, Field(description="Value is the value of the metric")] class CreateS3BucketOptions(BaseModel): - object_locking: Optional[bool] = Field( - default=None, - alias="objectLocking", - description="ObjectLocking Enable object locking", - ) + object_locking: Annotated[ + Optional[bool], + Field(alias="objectLocking", description="ObjectLocking Enable object locking"), + ] = None class CronWorkflowDeletedResponse(BaseModel): @@ -126,14 +172,33 @@ class CronWorkflowSuspendRequest(BaseModel): namespace: Optional[str] = None +class TemplateRef(BaseModel): + cluster_scope: Annotated[ + Optional[bool], + Field( + alias="clusterScope", + description=( + "ClusterScope indicates the referred template is cluster scoped (i.e. a" " ClusterWorkflowTemplate)." + ), + ), + ] = None + name: Annotated[Optional[str], Field(description="Name is the resource name of the template.")] = None + template: Annotated[ + Optional[str], + Field(description="Template is the name of referred template in the resource."), + ] = None + + class Event(BaseModel): - selector: str = Field( - ..., - description=( - "Selector (https://github.com/antonmedv/expr) that we must must match the" - ' io.argoproj.workflow.v1alpha1. E.g. `payload.message == "test"`' + selector: Annotated[ + str, + Field( + description=( + "Selector (https://github.com/antonmedv/expr) that we must must match" + ' the io.argoproj.workflow.v1alpha1. E.g. `payload.message == "test"`' + ) ), - ) + ] class EventResponse(BaseModel): @@ -141,25 +206,27 @@ class EventResponse(BaseModel): class ExecutorConfig(BaseModel): - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - description=("ServiceAccountName specifies the service account name of the executor" " container."), - ) + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + description=("ServiceAccountName specifies the service account name of the executor" " container."), + ), + ] = None class Gauge(BaseModel): - realtime: bool = Field(..., description="Realtime emits this metric in real time if applicable") - value: str = Field(..., description="Value is the value of the metric") + realtime: Annotated[bool, Field(description="Realtime emits this metric in real time if applicable")] + value: Annotated[str, Field(description="Value is the value of the metric")] class GetUserInfoResponse(BaseModel): email: Optional[str] = None - email_verified: Optional[bool] = Field(default=None, alias="emailVerified") + email_verified: Annotated[Optional[bool], Field(alias="emailVerified")] = None groups: Optional[List[str]] = None issuer: Optional[str] = None - service_account_name: Optional[str] = Field(default=None, alias="serviceAccountName") - service_account_namespace: Optional[str] = Field(default=None, alias="serviceAccountNamespace") + service_account_name: Annotated[Optional[str], Field(alias="serviceAccountName")] = None + service_account_namespace: Annotated[Optional[str], Field(alias="serviceAccountNamespace")] = None subject: Optional[str] = None @@ -168,23 +235,28 @@ class HTTPBodySource(BaseModel): class Header(BaseModel): - name: str = Field(..., description="Name is the header name") - value: str = Field(..., description="Value is the literal value to use for the header") + name: Annotated[str, Field(description="Name is the header name")] + value: Annotated[str, Field(description="Value is the literal value to use for the header")] class Histogram(BaseModel): - buckets: List[Amount] = Field(..., description="Buckets is a list of bucket divisors for the histogram") - value: str = Field(..., description="Value is the value of the metric") + buckets: Annotated[ + List[Amount], + Field(description="Buckets is a list of bucket divisors for the histogram"), + ] + value: Annotated[str, Field(description="Value is the value of the metric")] class Item(BaseModel): - __root__: Any = Field( - ..., - description=( - "Item expands a single workflow step into multiple parallel steps The value" - " of Item can be a map, string, bool, or number" + __root__: Annotated[ + Any, + Field( + description=( + "Item expands a single workflow step into multiple parallel steps The" + " value of Item can be a map, string, bool, or number" + ) ), - ) + ] class LabelKeys(BaseModel): @@ -200,43 +272,45 @@ class LabelValues(BaseModel): class Link(BaseModel): - name: str = Field(..., description='The name of the link, E.g. "Workflow Logs" or "Pod Logs"') - scope: str = Field( - ..., - description=('"workflow", "pod", "pod-logs", "event-source-logs", "sensor-logs" or' ' "chat"'), - ) - url: str = Field( - ..., - description=( - 'The URL. Can contain "${metadata.namespace}", "${metadata.name}",' - ' "${status.startedAt}", "${status.finishedAt}" or any other element in' - " workflow yaml, e.g." - ' "${io.argoproj.workflow.v1alpha1.metadata.annotations.userDefinedKey}"' - ), - ) + name: Annotated[ + str, + Field(description='The name of the link, E.g. "Workflow Logs" or "Pod Logs"'), + ] + scope: Annotated[ + str, + Field(description=('"workflow", "pod", "pod-logs", "event-source-logs", "sensor-logs" or' ' "chat"')), + ] + url: Annotated[ + str, + Field( + description=( + 'The URL. Can contain "${metadata.namespace}", "${metadata.name}",' + ' "${status.startedAt}", "${status.finishedAt}" or any other element in' + " workflow yaml, e.g." + ' "${io.argoproj.workflow.v1alpha1.metadata.annotations.userDefinedKey}"' + ) + ), + ] class LogEntry(BaseModel): content: Optional[str] = None - pod_name: Optional[str] = Field(default=None, alias="podName") + pod_name: Annotated[Optional[str], Field(alias="podName")] = None class MemoizationStatus(BaseModel): - cache_name: str = Field( - ..., - alias="cacheName", - description="Cache is the name of the cache that was used", - ) - hit: bool = Field( - ..., - description="Hit indicates whether this node was created from a cache entry", - ) - key: str = Field(..., description="Key is the name of the key used for this node's cache") - - -class Metadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None + cache_name: Annotated[ + str, + Field( + alias="cacheName", + description="Cache is the name of the cache that was used", + ), + ] + hit: Annotated[ + bool, + Field(description="Hit indicates whether this node was created from a cache entry"), + ] + key: Annotated[str, Field(description="Key is the name of the key used for this node's cache")] class MetricLabel(BaseModel): @@ -245,93 +319,85 @@ class MetricLabel(BaseModel): class Mutex(BaseModel): - name: Optional[str] = Field(default=None, description="name of the mutex") + name: Annotated[Optional[str], Field(description="name of the mutex")] = None class MutexHolding(BaseModel): - holder: Optional[str] = Field( - default=None, - description=( - "Holder is a reference to the object which holds the Mutex. Holding" - " Scenario:\n 1. Current workflow's NodeID which is holding the lock.\n " - " e.g: ${NodeID}\nWaiting Scenario:\n 1. Current workflow or other" - " workflow NodeID which is holding the lock.\n e.g:" - " ${WorkflowName}/${NodeID}" - ), - ) - mutex: Optional[str] = Field( - default=None, - description="Reference for the mutex e.g: ${namespace}/mutex/${mutexName}", - ) + holder: Annotated[ + Optional[str], + Field( + description=( + "Holder is a reference to the object which holds the Mutex. Holding" + " Scenario:\n 1. Current workflow's NodeID which is holding the" + " lock.\n e.g: ${NodeID}\nWaiting Scenario:\n 1. Current workflow" + " or other workflow NodeID which is holding the lock.\n e.g:" + " ${WorkflowName}/${NodeID}" + ) + ), + ] = None + mutex: Annotated[ + Optional[str], + Field(description="Reference for the mutex e.g: ${namespace}/mutex/${mutexName}"), + ] = None class MutexStatus(BaseModel): - holding: Optional[List[MutexHolding]] = Field( - default=None, - description=( - "Holding is a list of mutexes and their respective objects that are held by" - " mutex lock for this io.argoproj.workflow.v1alpha1." + holding: Annotated[ + Optional[List[MutexHolding]], + Field( + description=( + "Holding is a list of mutexes and their respective objects that are" + " held by mutex lock for this io.argoproj.workflow.v1alpha1." + ) ), - ) - waiting: Optional[List[MutexHolding]] = Field( - default=None, - description=("Waiting is a list of mutexes and their respective objects this workflow is" " waiting for."), - ) + ] = None + waiting: Annotated[ + Optional[List[MutexHolding]], + Field( + description=("Waiting is a list of mutexes and their respective objects this" " workflow is waiting for.") + ), + ] = None class NodeSynchronizationStatus(BaseModel): - waiting: Optional[str] = Field( - default=None, - description="Waiting is the name of the lock that this node is waiting for", - ) - - -class NoneStrategy(BaseModel): - pass + waiting: Annotated[ + Optional[str], + Field(description="Waiting is the name of the lock that this node is waiting for"), + ] = None class OAuth2EndpointParam(BaseModel): - key: str = Field(..., description="Name is the header name") - value: Optional[str] = Field(default=None, description="Value is the literal value to use for the header") + key: Annotated[str, Field(description="Name is the header name")] + value: Annotated[ + Optional[str], + Field(description="Value is the literal value to use for the header"), + ] = None class OSSLifecycleRule(BaseModel): - mark_deletion_after_days: Optional[int] = Field( - default=None, - alias="markDeletionAfterDays", - description=("MarkDeletionAfterDays is the number of days before we delete objects in" " the bucket"), - ) - mark_infrequent_access_after_days: Optional[int] = Field( - default=None, - alias="markInfrequentAccessAfterDays", - description=( - "MarkInfrequentAccessAfterDays is the number of days before we convert the" - " objects in the bucket to Infrequent Access (IA) storage type" + mark_deletion_after_days: Annotated[ + Optional[int], + Field( + alias="markDeletionAfterDays", + description=("MarkDeletionAfterDays is the number of days before we delete objects" " in the bucket"), + ), + ] = None + mark_infrequent_access_after_days: Annotated[ + Optional[int], + Field( + alias="markInfrequentAccessAfterDays", + description=( + "MarkInfrequentAccessAfterDays is the number of days before we convert" + " the objects in the bucket to Infrequent Access (IA) storage type" + ), ), - ) + ] = None class Plugin(BaseModel): pass -class Prometheus(BaseModel): - counter: Optional[Counter] = Field(default=None, description="Counter is a counter metric") - gauge: Optional[Gauge] = Field(default=None, description="Gauge is a gauge metric") - help: str = Field(..., description="Help is a string that describes the metric") - histogram: Optional[Histogram] = Field(default=None, description="Histogram is a histogram metric") - labels: Optional[List[MetricLabel]] = Field(default=None, description="Labels is a list of metric labels") - name: str = Field(..., description="Name is the name of the metric") - when: Optional[str] = Field( - default=None, - description=("When is a conditional statement that decides when to emit the metric"), - ) - - -class RawArtifact(BaseModel): - data: str = Field(..., description="Data is the string contents of the artifact") - - class ResubmitArchivedWorkflowRequest(BaseModel): memoized: Optional[bool] = None name: Optional[str] = None @@ -340,36 +406,54 @@ class ResubmitArchivedWorkflowRequest(BaseModel): uid: Optional[str] = None +class RetryNodeAntiAffinity(BaseModel): + pass + + class RetryArchivedWorkflowRequest(BaseModel): name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None parameters: Optional[List[str]] = None - restart_successful: Optional[bool] = Field(default=None, alias="restartSuccessful") + restart_successful: Annotated[Optional[bool], Field(alias="restartSuccessful")] = None uid: Optional[str] = None -class RetryNodeAntiAffinity(BaseModel): - pass - - class SemaphoreHolding(BaseModel): - holders: Optional[List[str]] = Field( - default=None, - description=("Holders stores the list of current holder names in the" " io.argoproj.workflow.v1alpha1."), - ) - semaphore: Optional[str] = Field(default=None, description="Semaphore stores the semaphore name.") + holders: Annotated[ + Optional[List[str]], + Field( + description=("Holders stores the list of current holder names in the" " io.argoproj.workflow.v1alpha1.") + ), + ] = None + semaphore: Annotated[Optional[str], Field(description="Semaphore stores the semaphore name.")] = None class SemaphoreStatus(BaseModel): - holding: Optional[List[SemaphoreHolding]] = Field( - default=None, - description=("Holding stores the list of resource acquired synchronization lock for" " workflows."), - ) - waiting: Optional[List[SemaphoreHolding]] = Field( - default=None, - description=("Waiting indicates the list of current synchronization lock holders."), - ) + holding: Annotated[ + Optional[List[SemaphoreHolding]], + Field(description=("Holding stores the list of resource acquired synchronization lock for" " workflows.")), + ] = None + waiting: Annotated[ + Optional[List[SemaphoreHolding]], + Field(description=("Waiting indicates the list of current synchronization lock holders.")), + ] = None + + +class WorkflowTemplateRef(BaseModel): + cluster_scope: Annotated[ + Optional[bool], + Field( + alias="clusterScope", + description=( + "ClusterScope indicates the referred template is cluster scoped (i.e. a" " ClusterWorkflowTemplate)." + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field(description="Name is the resource name of the workflow template."), + ] = None class SuppliedValueFrom(BaseModel): @@ -377,88 +461,62 @@ class SuppliedValueFrom(BaseModel): class SuspendTemplate(BaseModel): - duration: Optional[str] = Field( - default=None, - description=( - "Duration is the seconds to wait before automatically resuming a template." - " Must be a string. Default unit is seconds. Could also be a Duration," - ' e.g.: "2m", "6h", "1d"' + duration: Annotated[ + Optional[str], + Field( + description=( + "Duration is the seconds to wait before automatically resuming a" + " template. Must be a string. Default unit is seconds. Could also be a" + ' Duration, e.g.: "2m", "6h", "1d"' + ) ), - ) - - -class SynchronizationStatus(BaseModel): - mutex: Optional[MutexStatus] = Field(default=None, description="Mutex stores this workflow's mutex holder details") - semaphore: Optional[SemaphoreStatus] = Field( - default=None, - description="Semaphore stores this workflow's Semaphore holder details", - ) + ] = None class TTLStrategy(BaseModel): - seconds_after_completion: Optional[int] = Field( - default=None, - alias="secondsAfterCompletion", - description=("SecondsAfterCompletion is the number of seconds to live after completion"), - ) - seconds_after_failure: Optional[int] = Field( - default=None, - alias="secondsAfterFailure", - description=("SecondsAfterFailure is the number of seconds to live after failure"), - ) - seconds_after_success: Optional[int] = Field( - default=None, - alias="secondsAfterSuccess", - description=("SecondsAfterSuccess is the number of seconds to live after success"), - ) - - -class TarStrategy(BaseModel): - compression_level: Optional[int] = Field( - default=None, - alias="compressionLevel", - description=( - "CompressionLevel specifies the gzip compression level to use for the" - " artifact. Defaults to gzip.DefaultCompression." + seconds_after_completion: Annotated[ + Optional[int], + Field( + alias="secondsAfterCompletion", + description=("SecondsAfterCompletion is the number of seconds to live after" " completion"), ), - ) - - -class TemplateRef(BaseModel): - cluster_scope: Optional[bool] = Field( - default=None, - alias="clusterScope", - description=( - "ClusterScope indicates the referred template is cluster scoped (i.e. a" " ClusterWorkflowTemplate)." + ] = None + seconds_after_failure: Annotated[ + Optional[int], + Field( + alias="secondsAfterFailure", + description=("SecondsAfterFailure is the number of seconds to live after failure"), + ), + ] = None + seconds_after_success: Annotated[ + Optional[int], + Field( + alias="secondsAfterSuccess", + description=("SecondsAfterSuccess is the number of seconds to live after success"), ), - ) - name: Optional[str] = Field(default=None, description="Name is the resource name of the template.") - template: Optional[str] = Field( - default=None, - description="Template is the name of referred template in the resource.", - ) + ] = None class TransformationStep(BaseModel): - expression: str = Field(..., description="Expression defines an expr expression to apply") + expression: Annotated[str, Field(description="Expression defines an expr expression to apply")] class Version(BaseModel): - build_date: str = Field(..., alias="buildDate") + build_date: Annotated[str, Field(alias="buildDate")] compiler: str - git_commit: str = Field(..., alias="gitCommit") - git_tag: str = Field(..., alias="gitTag") - git_tree_state: str = Field(..., alias="gitTreeState") - go_version: str = Field(..., alias="goVersion") + git_commit: Annotated[str, Field(alias="gitCommit")] + git_tag: Annotated[str, Field(alias="gitTag")] + git_tree_state: Annotated[str, Field(alias="gitTreeState")] + go_version: Annotated[str, Field(alias="goVersion")] platform: str version: str class VolumeClaimGC(BaseModel): - strategy: Optional[str] = Field( - default=None, - description=('Strategy is the strategy to use. One of "OnWorkflowCompletion",' ' "OnWorkflowSuccess"'), - ) + strategy: Annotated[ + Optional[str], + Field(description=('Strategy is the strategy to use. One of "OnWorkflowCompletion",' ' "OnWorkflowSuccess"')), + ] = None class WorkflowDeleteResponse(BaseModel): @@ -468,7 +526,7 @@ class WorkflowDeleteResponse(BaseModel): class WorkflowMetadata(BaseModel): annotations: Optional[Dict[str, str]] = None labels: Optional[Dict[str, str]] = None - labels_from: Optional[Dict[str, LabelValueFrom]] = Field(default=None, alias="labelsFrom") + labels_from: Annotated[Optional[Dict[str, LabelValueFrom]], Field(alias="labelsFrom")] = None class WorkflowResubmitRequest(BaseModel): @@ -481,23 +539,23 @@ class WorkflowResubmitRequest(BaseModel): class WorkflowResumeRequest(BaseModel): name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None class WorkflowRetryRequest(BaseModel): name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None parameters: Optional[List[str]] = None - restart_successful: Optional[bool] = Field(default=None, alias="restartSuccessful") + restart_successful: Annotated[Optional[bool], Field(alias="restartSuccessful")] = None class WorkflowSetRequest(BaseModel): message: Optional[str] = None name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") - output_parameters: Optional[str] = Field(default=None, alias="outputParameters") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None + output_parameters: Annotated[Optional[str], Field(alias="outputParameters")] = None phase: Optional[str] = None @@ -505,7 +563,7 @@ class WorkflowStopRequest(BaseModel): message: Optional[str] = None name: Optional[str] = None namespace: Optional[str] = None - node_field_selector: Optional[str] = Field(default=None, alias="nodeFieldSelector") + node_field_selector: Annotated[Optional[str], Field(alias="nodeFieldSelector")] = None class WorkflowSuspendRequest(BaseModel): @@ -517,2000 +575,1735 @@ class WorkflowTemplateDeleteResponse(BaseModel): pass -class WorkflowTemplateRef(BaseModel): - cluster_scope: Optional[bool] = Field( - default=None, - alias="clusterScope", - description=( - "ClusterScope indicates the referred template is cluster scoped (i.e. a" " ClusterWorkflowTemplate)." - ), - ) - name: Optional[str] = Field(default=None, description="Name is the resource name of the workflow template.") - - class WorkflowTerminateRequest(BaseModel): name: Optional[str] = None namespace: Optional[str] = None -class ZipStrategy(BaseModel): - pass - - -class ArchiveStrategy(BaseModel): - none: Optional[NoneStrategy] = None - tar: Optional[TarStrategy] = None - zip: Optional[ZipStrategy] = None +class CronWorkflowStatus(BaseModel): + active: Annotated[ + Optional[List[v1.ObjectReference]], + Field(description=("Active is a list of active workflows stemming from this CronWorkflow")), + ] = None + conditions: Annotated[ + Optional[List[Condition]], + Field(description="Conditions is a list of conditions the CronWorkflow may have"), + ] = None + last_scheduled_time: Annotated[ + Optional[v1_1.Time], + Field( + alias="lastScheduledTime", + description=("LastScheduleTime is the last time the CronWorkflow was scheduled"), + ), + ] = None -class ArtifactGC(BaseModel): - pod_metadata: Optional[Metadata] = Field( - default=None, - alias="podMetadata", - description=( - "PodMetadata is an optional field for specifying the Labels and Annotations" - " that should be assigned to the Pod doing the deletion" +class ArtifactoryArtifact(BaseModel): + password_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="passwordSecret", + description=("PasswordSecret is the secret selector to the repository password"), ), - ) - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - description=( - "ServiceAccountName is an optional field for specifying the Service Account" - " that should be assigned to the Pod doing the deletion" + ] = None + url: Annotated[str, Field(description="URL of the artifact")] + username_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="usernameSecret", + description=("UsernameSecret is the secret selector to the repository username"), ), - ) - strategy: Optional[str] = Field(default=None, description="Strategy is the strategy to use.") - - -class ArtifactGCStatus(BaseModel): - artifact_results_by_node: Optional[Dict[str, ArtifactResultNodeStatus]] = Field( - default=None, - alias="artifactResultsByNode", - description="ArtifactResultsByNode maps Node name to result", - ) - - -class ArtifactoryArtifact(BaseModel): - password_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="passwordSecret", - description="PasswordSecret is the secret selector to the repository password", - ) - url: str = Field(..., description="URL of the artifact") - username_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="usernameSecret", - description="UsernameSecret is the secret selector to the repository username", - ) + ] = None class ArtifactoryArtifactRepository(BaseModel): - password_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="passwordSecret", - description="PasswordSecret is the secret selector to the repository password", - ) - repo_url: Optional[str] = Field( - default=None, - alias="repoURL", - description="RepoURL is the url for artifactory repo.", - ) - username_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="usernameSecret", - description="UsernameSecret is the secret selector to the repository username", - ) + password_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="passwordSecret", + description=("PasswordSecret is the secret selector to the repository password"), + ), + ] = None + repo_url: Annotated[ + Optional[str], + Field(alias="repoURL", description="RepoURL is the url for artifactory repo."), + ] = None + username_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="usernameSecret", + description=("UsernameSecret is the secret selector to the repository username"), + ), + ] = None class AzureArtifact(BaseModel): - account_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accountKeySecret", - description=("AccountKeySecret is the secret selector to the Azure Blob Storage account" " access key"), - ) - blob: str = Field( - ..., - description=("Blob is the blob name (i.e., path) in the container where the artifact" " resides"), - ) - container: str = Field(..., description="Container is the container where resources will be stored") - endpoint: str = Field( - ..., - description=( - "Endpoint is the service url associated with an account. It is most likely" - ' "https://.blob.core.windows.net"' - ), - ) - use_sdk_creds: Optional[bool] = Field( - default=None, - alias="useSDKCreds", - description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), - ) + account_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accountKeySecret", + description=("AccountKeySecret is the secret selector to the Azure Blob Storage" " account access key"), + ), + ] = None + blob: Annotated[ + str, + Field(description=("Blob is the blob name (i.e., path) in the container where the artifact" " resides")), + ] + container: Annotated[ + str, + Field(description="Container is the container where resources will be stored"), + ] + endpoint: Annotated[ + str, + Field( + description=( + "Endpoint is the service url associated with an account. It is most" + ' likely "https://.blob.core.windows.net"' + ) + ), + ] + use_sdk_creds: Annotated[ + Optional[bool], + Field( + alias="useSDKCreds", + description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), + ), + ] = None class AzureArtifactRepository(BaseModel): - account_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accountKeySecret", - description=("AccountKeySecret is the secret selector to the Azure Blob Storage account" " access key"), - ) - blob_name_format: Optional[str] = Field( - default=None, - alias="blobNameFormat", - description=( - "BlobNameFormat is defines the format of how to store blob names. Can" " reference workflow variables" - ), - ) - container: str = Field(..., description="Container is the container where resources will be stored") - endpoint: str = Field( - ..., - description=( - "Endpoint is the service url associated with an account. It is most likely" - ' "https://.blob.core.windows.net"' - ), - ) - use_sdk_creds: Optional[bool] = Field( - default=None, - alias="useSDKCreds", - description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), - ) - - -class Backoff(BaseModel): - duration: Optional[str] = Field( - default=None, - description=( - "Duration is the amount to back off. Default unit is seconds, but could" - ' also be a duration (e.g. "2m", "1h")' - ), - ) - factor: Optional[intstr.IntOrString] = Field( - default=None, - description=("Factor is a factor to multiply the base duration after each failed retry"), - ) - max_duration: Optional[str] = Field( - default=None, - alias="maxDuration", - description=("MaxDuration is the maximum amount of time allowed for the backoff strategy"), - ) + account_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accountKeySecret", + description=("AccountKeySecret is the secret selector to the Azure Blob Storage" " account access key"), + ), + ] = None + blob_name_format: Annotated[ + Optional[str], + Field( + alias="blobNameFormat", + description=( + "BlobNameFormat is defines the format of how to store blob names. Can" " reference workflow variables" + ), + ), + ] = None + container: Annotated[ + str, + Field(description="Container is the container where resources will be stored"), + ] + endpoint: Annotated[ + str, + Field( + description=( + "Endpoint is the service url associated with an account. It is most" + ' likely "https://.blob.core.windows.net"' + ) + ), + ] + use_sdk_creds: Annotated[ + Optional[bool], + Field( + alias="useSDKCreds", + description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), + ), + ] = None class BasicAuth(BaseModel): - password_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="passwordSecret", - description="PasswordSecret is the secret selector to the repository password", - ) - username_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="usernameSecret", - description="UsernameSecret is the secret selector to the repository username", - ) - - -class Cache(BaseModel): - config_map: v1.ConfigMapKeySelector = Field( - ..., alias="configMap", description="ConfigMap sets a ConfigMap-based cache" - ) + password_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="passwordSecret", + description=("PasswordSecret is the secret selector to the repository password"), + ), + ] = None + username_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="usernameSecret", + description=("UsernameSecret is the secret selector to the repository username"), + ), + ] = None class ClientCertAuth(BaseModel): - client_cert_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="clientCertSecret") - client_key_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="clientKeySecret") + client_cert_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="clientCertSecret")] = None + client_key_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="clientKeySecret")] = None -class ContainerSetRetryStrategy(BaseModel): - duration: Optional[str] = Field( - default=None, - description=( - 'Duration is the time between each retry, examples values are "300ms", "1s"' - ' or "5m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".' +class GCSArtifact(BaseModel): + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + key: Annotated[ + str, + Field(description="Key is the path in the bucket where the artifact resides"), + ] + service_account_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="serviceAccountKeySecret", + description=("ServiceAccountKeySecret is the secret selector to the bucket's service" " account key"), ), - ) - retries: intstr.IntOrString = Field(..., description="Nbr of retries") + ] = None -class CronWorkflowStatus(BaseModel): - active: Optional[List[v1.ObjectReference]] = Field( - default=None, - description=("Active is a list of active workflows stemming from this CronWorkflow"), - ) - conditions: Optional[List[Condition]] = Field( - default=None, - description="Conditions is a list of conditions the CronWorkflow may have", - ) - last_scheduled_time: Optional[v1_1.Time] = Field( - default=None, - alias="lastScheduledTime", - description="LastScheduleTime is the last time the CronWorkflow was scheduled", - ) +class GCSArtifactRepository(BaseModel): + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + key_format: Annotated[ + Optional[str], + Field( + alias="keyFormat", + description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), + ), + ] = None + service_account_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="serviceAccountKeySecret", + description=("ServiceAccountKeySecret is the secret selector to the bucket's service" " account key"), + ), + ] = None -class GCSArtifact(BaseModel): - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - key: str = Field(..., description="Key is the path in the bucket where the artifact resides") - service_account_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serviceAccountKeySecret", - description=("ServiceAccountKeySecret is the secret selector to the bucket's service" " account key"), - ) +class GitArtifact(BaseModel): + branch: Annotated[ + Optional[str], + Field(description="Branch is the branch to fetch when `SingleBranch` is enabled"), + ] = None + depth: Annotated[ + Optional[int], + Field( + description=( + "Depth specifies clones/fetches should be shallow and include the given" + " number of commits from the branch tip" + ) + ), + ] = None + disable_submodules: Annotated[ + Optional[bool], + Field( + alias="disableSubmodules", + description="DisableSubmodules disables submodules during git clone", + ), + ] = None + fetch: Annotated[ + Optional[List[str]], + Field(description=("Fetch specifies a number of refs that should be fetched before" " checkout")), + ] = None + insecure_ignore_host_key: Annotated[ + Optional[bool], + Field( + alias="insecureIgnoreHostKey", + description=("InsecureIgnoreHostKey disables SSH strict host key checking during git" " clone"), + ), + ] = None + password_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="passwordSecret", + description=("PasswordSecret is the secret selector to the repository password"), + ), + ] = None + repo: Annotated[str, Field(description="Repo is the git repository")] + revision: Annotated[ + Optional[str], + Field(description="Revision is the git commit, tag, branch to checkout"), + ] = None + single_branch: Annotated[ + Optional[bool], + Field( + alias="singleBranch", + description=("SingleBranch enables single branch clone, using the `branch` parameter"), + ), + ] = None + ssh_private_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="sshPrivateKeySecret", + description=("SSHPrivateKeySecret is the secret selector to the repository ssh" " private key"), + ), + ] = None + username_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="usernameSecret", + description=("UsernameSecret is the secret selector to the repository username"), + ), + ] = None -class GCSArtifactRepository(BaseModel): - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - key_format: Optional[str] = Field( - default=None, - alias="keyFormat", - description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), - ) - service_account_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serviceAccountKeySecret", - description=("ServiceAccountKeySecret is the secret selector to the bucket's service" " account key"), - ) +class HTTPHeaderSource(BaseModel): + secret_key_ref: Annotated[Optional[v1.SecretKeySelector], Field(alias="secretKeyRef")] = None -class GitArtifact(BaseModel): - branch: Optional[str] = Field( - default=None, - description="Branch is the branch to fetch when `SingleBranch` is enabled", - ) - depth: Optional[int] = Field( - default=None, - description=( - "Depth specifies clones/fetches should be shallow and include the given" - " number of commits from the branch tip" - ), - ) - disable_submodules: Optional[bool] = Field( - default=None, - alias="disableSubmodules", - description="DisableSubmodules disables submodules during git clone", - ) - fetch: Optional[List[str]] = Field( - default=None, - description=("Fetch specifies a number of refs that should be fetched before checkout"), - ) - insecure_ignore_host_key: Optional[bool] = Field( - default=None, - alias="insecureIgnoreHostKey", - description=("InsecureIgnoreHostKey disables SSH strict host key checking during git" " clone"), - ) - password_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="passwordSecret", - description="PasswordSecret is the secret selector to the repository password", - ) - repo: str = Field(..., description="Repo is the git repository") - revision: Optional[str] = Field(default=None, description="Revision is the git commit, tag, branch to checkout") - single_branch: Optional[bool] = Field( - default=None, - alias="singleBranch", - description=("SingleBranch enables single branch clone, using the `branch` parameter"), - ) - ssh_private_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="sshPrivateKeySecret", - description=("SSHPrivateKeySecret is the secret selector to the repository ssh" " private key"), - ) - username_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="usernameSecret", - description="UsernameSecret is the secret selector to the repository username", - ) +class OAuth2Auth(BaseModel): + client_id_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="clientIDSecret")] = None + client_secret_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="clientSecretSecret")] = None + endpoint_params: Annotated[Optional[List[OAuth2EndpointParam]], Field(alias="endpointParams")] = None + scopes: Optional[List[str]] = None + token_url_secret: Annotated[Optional[v1.SecretKeySelector], Field(alias="tokenURLSecret")] = None -class HDFSArtifact(BaseModel): - addresses: Optional[List[str]] = Field( - default=None, description="Addresses is accessible addresses of HDFS name nodes" - ) - force: Optional[bool] = Field(default=None, description="Force copies a file forcibly even if it exists") - hdfs_user: Optional[str] = Field( - default=None, - alias="hdfsUser", - description=( - "HDFSUser is the user to access HDFS file system. It is ignored if either" " ccache or keytab is used." - ), - ) - krb_c_cache_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbCCacheSecret", - description=( - "KrbCCacheSecret is the secret selector for Kerberos ccache Either ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_config_config_map: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="krbConfigConfigMap", - description=( - "KrbConfig is the configmap selector for Kerberos config as string It must" - " be set if either ccache or keytab is used." - ), - ) - krb_keytab_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbKeytabSecret", - description=( - "KrbKeytabSecret is the secret selector for Kerberos keytab Either ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_realm: Optional[str] = Field( - default=None, - alias="krbRealm", - description=("KrbRealm is the Kerberos realm used with Kerberos keytab It must be set if" " keytab is used."), - ) - krb_service_principal_name: Optional[str] = Field( - default=None, - alias="krbServicePrincipalName", - description=( - "KrbServicePrincipalName is the principal name of Kerberos service It must" - " be set if either ccache or keytab is used." - ), - ) - krb_username: Optional[str] = Field( - default=None, - alias="krbUsername", - description=( - "KrbUsername is the Kerberos username used with Kerberos keytab It must be" " set if keytab is used." - ), - ) - path: str = Field(..., description="Path is a file path in HDFS") +class S3EncryptionOptions(BaseModel): + enable_encryption: Annotated[ + Optional[bool], + Field( + alias="enableEncryption", + description=( + "EnableEncryption tells the driver to encrypt objects if set to true." + " If kmsKeyId and serverSideCustomerKeySecret are not set, SSE-S3 will" + " be used" + ), + ), + ] = None + kms_encryption_context: Annotated[ + Optional[str], + Field( + alias="kmsEncryptionContext", + description=( + "KmsEncryptionContext is a json blob that contains an encryption" + " context. See" + " https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context" + " for more information" + ), + ), + ] = None + kms_key_id: Annotated[ + Optional[str], + Field( + alias="kmsKeyId", + description=("KMSKeyId tells the driver to encrypt the object using the specified" " KMS Key."), + ), + ] = None + server_side_customer_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="serverSideCustomerKeySecret", + description=( + "ServerSideCustomerKeySecret tells the driver to encrypt the output" + " artifacts using SSE-C with the specified secret." + ), + ), + ] = None -class HDFSArtifactRepository(BaseModel): - addresses: Optional[List[str]] = Field( - default=None, description="Addresses is accessible addresses of HDFS name nodes" - ) - force: Optional[bool] = Field(default=None, description="Force copies a file forcibly even if it exists") - hdfs_user: Optional[str] = Field( - default=None, - alias="hdfsUser", - description=( - "HDFSUser is the user to access HDFS file system. It is ignored if either" " ccache or keytab is used." - ), - ) - krb_c_cache_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbCCacheSecret", - description=( - "KrbCCacheSecret is the secret selector for Kerberos ccache Either ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_config_config_map: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="krbConfigConfigMap", - description=( - "KrbConfig is the configmap selector for Kerberos config as string It must" - " be set if either ccache or keytab is used." - ), - ) - krb_keytab_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="krbKeytabSecret", - description=( - "KrbKeytabSecret is the secret selector for Kerberos keytab Either ccache" - " or keytab can be set to use Kerberos." - ), - ) - krb_realm: Optional[str] = Field( - default=None, - alias="krbRealm", - description=("KrbRealm is the Kerberos realm used with Kerberos keytab It must be set if" " keytab is used."), - ) - krb_service_principal_name: Optional[str] = Field( - default=None, - alias="krbServicePrincipalName", - description=( - "KrbServicePrincipalName is the principal name of Kerberos service It must" - " be set if either ccache or keytab is used." - ), - ) - krb_username: Optional[str] = Field( - default=None, - alias="krbUsername", - description=( - "KrbUsername is the Kerberos username used with Kerberos keytab It must be" " set if keytab is used." - ), - ) - path_format: Optional[str] = Field( - default=None, - alias="pathFormat", - description=("PathFormat is defines the format of path to store a file. Can reference" " workflow variables"), - ) +class Cache(BaseModel): + config_map: Annotated[ + v1.ConfigMapKeySelector, + Field(alias="configMap", description="ConfigMap sets a ConfigMap-based cache"), + ] -class HTTPHeaderSource(BaseModel): - secret_key_ref: Optional[v1.SecretKeySelector] = Field(default=None, alias="secretKeyRef") +class HDFSArtifact(BaseModel): + addresses: Annotated[ + Optional[List[str]], + Field(description="Addresses is accessible addresses of HDFS name nodes"), + ] = None + force: Annotated[ + Optional[bool], + Field(description="Force copies a file forcibly even if it exists"), + ] = None + hdfs_user: Annotated[ + Optional[str], + Field( + alias="hdfsUser", + description=( + "HDFSUser is the user to access HDFS file system. It is ignored if" " either ccache or keytab is used." + ), + ), + ] = None + krb_c_cache_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="krbCCacheSecret", + description=( + "KrbCCacheSecret is the secret selector for Kerberos ccache Either" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_config_config_map: Annotated[ + Optional[v1.ConfigMapKeySelector], + Field( + alias="krbConfigConfigMap", + description=( + "KrbConfig is the configmap selector for Kerberos config as string It" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_keytab_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="krbKeytabSecret", + description=( + "KrbKeytabSecret is the secret selector for Kerberos keytab Either" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_realm: Annotated[ + Optional[str], + Field( + alias="krbRealm", + description=( + "KrbRealm is the Kerberos realm used with Kerberos keytab It must be" " set if keytab is used." + ), + ), + ] = None + krb_service_principal_name: Annotated[ + Optional[str], + Field( + alias="krbServicePrincipalName", + description=( + "KrbServicePrincipalName is the principal name of Kerberos service It" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_username: Annotated[ + Optional[str], + Field( + alias="krbUsername", + description=( + "KrbUsername is the Kerberos username used with Kerberos keytab It must" " be set if keytab is used." + ), + ), + ] = None + path: Annotated[str, Field(description="Path is a file path in HDFS")] -class InfoResponse(BaseModel): - links: Optional[List[Link]] = None - managed_namespace: Optional[str] = Field(default=None, alias="managedNamespace") - modals: Optional[Dict[str, bool]] = Field(default=None, title="which modals to show") - nav_color: Optional[str] = Field(default=None, alias="navColor") +class HDFSArtifactRepository(BaseModel): + addresses: Annotated[ + Optional[List[str]], + Field(description="Addresses is accessible addresses of HDFS name nodes"), + ] = None + force: Annotated[ + Optional[bool], + Field(description="Force copies a file forcibly even if it exists"), + ] = None + hdfs_user: Annotated[ + Optional[str], + Field( + alias="hdfsUser", + description=( + "HDFSUser is the user to access HDFS file system. It is ignored if" " either ccache or keytab is used." + ), + ), + ] = None + krb_c_cache_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="krbCCacheSecret", + description=( + "KrbCCacheSecret is the secret selector for Kerberos ccache Either" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_config_config_map: Annotated[ + Optional[v1.ConfigMapKeySelector], + Field( + alias="krbConfigConfigMap", + description=( + "KrbConfig is the configmap selector for Kerberos config as string It" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_keytab_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="krbKeytabSecret", + description=( + "KrbKeytabSecret is the secret selector for Kerberos keytab Either" + " ccache or keytab can be set to use Kerberos." + ), + ), + ] = None + krb_realm: Annotated[ + Optional[str], + Field( + alias="krbRealm", + description=( + "KrbRealm is the Kerberos realm used with Kerberos keytab It must be" " set if keytab is used." + ), + ), + ] = None + krb_service_principal_name: Annotated[ + Optional[str], + Field( + alias="krbServicePrincipalName", + description=( + "KrbServicePrincipalName is the principal name of Kerberos service It" + " must be set if either ccache or keytab is used." + ), + ), + ] = None + krb_username: Annotated[ + Optional[str], + Field( + alias="krbUsername", + description=( + "KrbUsername is the Kerberos username used with Kerberos keytab It must" " be set if keytab is used." + ), + ), + ] = None + path_format: Annotated[ + Optional[str], + Field( + alias="pathFormat", + description=( + "PathFormat is defines the format of path to store a file. Can" " reference workflow variables" + ), + ), + ] = None -class Memoize(BaseModel): - cache: Cache = Field(..., description="Cache sets and configures the kind of cache") - key: str = Field(..., description="Key is the key to use as the caching key") - max_age: str = Field( - ..., - alias="maxAge", - description=( - 'MaxAge is the maximum age (e.g. "180s", "24h") of an entry that is still' - " considered valid. If an entry is older than the MaxAge, it will be" - " ignored." +class SemaphoreRef(BaseModel): + config_map_key_ref: Annotated[ + Optional[v1.ConfigMapKeySelector], + Field( + alias="configMapKeyRef", + description=("ConfigMapKeyRef is configmap selector for Semaphore configuration"), ), - ) + ] = None -class Metrics(BaseModel): - prometheus: Optional[List[Prometheus]] = Field( - default=None, - description="Prometheus is a list of prometheus metrics to be emitted", - ) +class ArchiveStrategy(BaseModel): + none: Optional[NoneStrategy] = None + tar: Optional[TarStrategy] = None + zip: Optional[ZipStrategy] = None -class OAuth2Auth(BaseModel): - client_id_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="clientIDSecret") - client_secret_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="clientSecretSecret") - endpoint_params: Optional[List[OAuth2EndpointParam]] = Field(default=None, alias="endpointParams") - scopes: Optional[List[str]] = None - token_url_secret: Optional[v1.SecretKeySelector] = Field(default=None, alias="tokenURLSecret") +class ArtifactGC(BaseModel): + pod_metadata: Annotated[ + Optional[Metadata], + Field( + alias="podMetadata", + description=( + "PodMetadata is an optional field for specifying the Labels and" + " Annotations that should be assigned to the Pod doing the deletion" + ), + ), + ] = None + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + description=( + "ServiceAccountName is an optional field for specifying the Service" + " Account that should be assigned to the Pod doing the deletion" + ), + ), + ] = None + strategy: Annotated[Optional[str], Field(description="Strategy is the strategy to use.")] = None -class OSSArtifact(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKeySecret", - description="AccessKeySecret is the secret selector to the bucket's access key", - ) - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - create_bucket_if_not_present: Optional[bool] = Field( - default=None, - alias="createBucketIfNotPresent", - description=( - "CreateBucketIfNotPresent tells the driver to attempt to create the OSS" - " bucket for output artifacts, if it doesn't exist" - ), - ) - endpoint: Optional[str] = Field(default=None, description="Endpoint is the hostname of the bucket endpoint") - key: str = Field(..., description="Key is the path in the bucket where the artifact resides") - lifecycle_rule: Optional[OSSLifecycleRule] = Field( - default=None, - alias="lifecycleRule", - description="LifecycleRule specifies how to manage bucket's lifecycle", - ) - secret_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKeySecret", - description="SecretKeySecret is the secret selector to the bucket's secret key", - ) - security_token: Optional[str] = Field( - default=None, - alias="securityToken", - description=( - "SecurityToken is the user's temporary security token. For more details," - " check out: https://www.alibabacloud.com/help/doc-detail/100624.htm" - ), - ) +class Backoff(BaseModel): + duration: Annotated[ + Optional[str], + Field( + description=( + "Duration is the amount to back off. Default unit is seconds, but could" + ' also be a duration (e.g. "2m", "1h")' + ) + ), + ] = None + factor: Annotated[ + Optional[intstr.IntOrString], + Field(description=("Factor is a factor to multiply the base duration after each failed" " retry")), + ] = None + max_duration: Annotated[ + Optional[str], + Field( + alias="maxDuration", + description=("MaxDuration is the maximum amount of time allowed for the backoff" " strategy"), + ), + ] = None -class OSSArtifactRepository(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKeySecret", - description="AccessKeySecret is the secret selector to the bucket's access key", - ) - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - create_bucket_if_not_present: Optional[bool] = Field( - default=None, - alias="createBucketIfNotPresent", - description=( - "CreateBucketIfNotPresent tells the driver to attempt to create the OSS" - " bucket for output artifacts, if it doesn't exist" - ), - ) - endpoint: Optional[str] = Field(default=None, description="Endpoint is the hostname of the bucket endpoint") - key_format: Optional[str] = Field( - default=None, - alias="keyFormat", - description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), - ) - lifecycle_rule: Optional[OSSLifecycleRule] = Field( - default=None, - alias="lifecycleRule", - description="LifecycleRule specifies how to manage bucket's lifecycle", - ) - secret_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKeySecret", - description="SecretKeySecret is the secret selector to the bucket's secret key", - ) - security_token: Optional[str] = Field( - default=None, - alias="securityToken", - description=( - "SecurityToken is the user's temporary security token. For more details," - " check out: https://www.alibabacloud.com/help/doc-detail/100624.htm" - ), - ) +class ContainerSetRetryStrategy(BaseModel): + duration: Annotated[ + Optional[str], + Field( + description=( + 'Duration is the time between each retry, examples values are "300ms",' + ' "1s" or "5m". Valid time units are "ns", "us" (or "µs"), "ms", "s",' + ' "m", "h".' + ) + ), + ] = None + retries: Annotated[intstr.IntOrString, Field(description="Nbr of retries")] -class RetryAffinity(BaseModel): - node_anti_affinity: Optional[RetryNodeAntiAffinity] = Field(default=None, alias="nodeAntiAffinity") +class Sequence(BaseModel): + count: Annotated[ + Optional[intstr.IntOrString], + Field(description=("Count is number of elements in the sequence (default: 0). Not to be" " used with end")), + ] = None + end: Annotated[ + Optional[intstr.IntOrString], + Field(description=("Number at which to end the sequence (default: 0). Not to be used with" " Count")), + ] = None + format: Annotated[ + Optional[str], + Field(description=("Format is a printf format string to format the value in the sequence")), + ] = None + start: Annotated[ + Optional[intstr.IntOrString], + Field(description="Number at which to start the sequence (default: 0)"), + ] = None -class RetryStrategy(BaseModel): - affinity: Optional[RetryAffinity] = Field( - default=None, - description="Affinity prevents running workflow's step on the same host", - ) - backoff: Optional[Backoff] = Field(default=None, description="Backoff is a backoff strategy") - expression: Optional[str] = Field( - default=None, - description=( - "Expression is a condition expression for when a node will be retried. If" - " it evaluates to false, the node will not be retried and the retry" - " strategy will be ignored" - ), - ) - limit: Optional[intstr.IntOrString] = Field( - default=None, - description=( - "Limit is the maximum number of retry attempts when retrying a container." - " It does not include the original container; the maximum number of total" - " attempts will be `limit + 1`." - ), - ) - retry_policy: Optional[str] = Field( - default=None, - alias="retryPolicy", - description=("RetryPolicy is a policy of NodePhase statuses that will be retried"), - ) +class Prometheus(BaseModel): + counter: Annotated[Optional[Counter], Field(description="Counter is a counter metric")] = None + gauge: Annotated[Optional[Gauge], Field(description="Gauge is a gauge metric")] = None + help: Annotated[str, Field(description="Help is a string that describes the metric")] + histogram: Annotated[Optional[Histogram], Field(description="Histogram is a histogram metric")] = None + labels: Annotated[ + Optional[List[MetricLabel]], + Field(description="Labels is a list of metric labels"), + ] = None + name: Annotated[str, Field(description="Name is the name of the metric")] + when: Annotated[ + Optional[str], + Field(description=("When is a conditional statement that decides when to emit the metric")), + ] = None -class S3EncryptionOptions(BaseModel): - enable_encryption: Optional[bool] = Field( - default=None, - alias="enableEncryption", - description=( - "EnableEncryption tells the driver to encrypt objects if set to true. If" - " kmsKeyId and serverSideCustomerKeySecret are not set, SSE-S3 will be used" - ), - ) - kms_encryption_context: Optional[str] = Field( - default=None, - alias="kmsEncryptionContext", - description=( - "KmsEncryptionContext is a json blob that contains an encryption context." - " See https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context" - " for more information" - ), - ) - kms_key_id: Optional[str] = Field( - default=None, - alias="kmsKeyId", - description=("KMSKeyId tells the driver to encrypt the object using the specified KMS" " Key."), - ) - server_side_customer_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="serverSideCustomerKeySecret", - description=( - "ServerSideCustomerKeySecret tells the driver to encrypt the output" - " artifacts using SSE-C with the specified secret." - ), - ) +class OSSArtifact(BaseModel): + access_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accessKeySecret", + description=("AccessKeySecret is the secret selector to the bucket's access key"), + ), + ] = None + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + create_bucket_if_not_present: Annotated[ + Optional[bool], + Field( + alias="createBucketIfNotPresent", + description=( + "CreateBucketIfNotPresent tells the driver to attempt to create the OSS" + " bucket for output artifacts, if it doesn't exist" + ), + ), + ] = None + endpoint: Annotated[ + Optional[str], + Field(description="Endpoint is the hostname of the bucket endpoint"), + ] = None + key: Annotated[ + str, + Field(description="Key is the path in the bucket where the artifact resides"), + ] + lifecycle_rule: Annotated[ + Optional[OSSLifecycleRule], + Field( + alias="lifecycleRule", + description="LifecycleRule specifies how to manage bucket's lifecycle", + ), + ] = None + secret_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="secretKeySecret", + description=("SecretKeySecret is the secret selector to the bucket's secret key"), + ), + ] = None + security_token: Annotated[ + Optional[str], + Field( + alias="securityToken", + description=( + "SecurityToken is the user's temporary security token. For more" + " details, check out:" + " https://www.alibabacloud.com/help/doc-detail/100624.htm" + ), + ), + ] = None -class SemaphoreRef(BaseModel): - config_map_key_ref: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="configMapKeyRef", - description="ConfigMapKeyRef is configmap selector for Semaphore configuration", - ) +class OSSArtifactRepository(BaseModel): + access_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accessKeySecret", + description=("AccessKeySecret is the secret selector to the bucket's access key"), + ), + ] = None + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + create_bucket_if_not_present: Annotated[ + Optional[bool], + Field( + alias="createBucketIfNotPresent", + description=( + "CreateBucketIfNotPresent tells the driver to attempt to create the OSS" + " bucket for output artifacts, if it doesn't exist" + ), + ), + ] = None + endpoint: Annotated[ + Optional[str], + Field(description="Endpoint is the hostname of the bucket endpoint"), + ] = None + key_format: Annotated[ + Optional[str], + Field( + alias="keyFormat", + description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), + ), + ] = None + lifecycle_rule: Annotated[ + Optional[OSSLifecycleRule], + Field( + alias="lifecycleRule", + description="LifecycleRule specifies how to manage bucket's lifecycle", + ), + ] = None + secret_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="secretKeySecret", + description=("SecretKeySecret is the secret selector to the bucket's secret key"), + ), + ] = None + security_token: Annotated[ + Optional[str], + Field( + alias="securityToken", + description=( + "SecurityToken is the user's temporary security token. For more" + " details, check out:" + " https://www.alibabacloud.com/help/doc-detail/100624.htm" + ), + ), + ] = None -class Sequence(BaseModel): - count: Optional[intstr.IntOrString] = Field( - default=None, - description=("Count is number of elements in the sequence (default: 0). Not to be used" " with end"), - ) - end: Optional[intstr.IntOrString] = Field( - default=None, - description=("Number at which to end the sequence (default: 0). Not to be used with" " Count"), - ) - format: Optional[str] = Field( - default=None, - description=("Format is a printf format string to format the value in the sequence"), - ) - start: Optional[intstr.IntOrString] = Field( - default=None, description="Number at which to start the sequence (default: 0)" - ) +class RetryAffinity(BaseModel): + node_anti_affinity: Annotated[Optional[RetryNodeAntiAffinity], Field(alias="nodeAntiAffinity")] = None -class SubmitOpts(BaseModel): - annotations: Optional[str] = Field(default=None, description="Annotations adds to metadata.labels") - dry_run: Optional[bool] = Field( - default=None, - alias="dryRun", - description=( - "DryRun validates the workflow on the client-side without creating it. This" - " option is not supported in API" - ), - ) - entry_point: Optional[str] = Field( - default=None, - alias="entryPoint", - description="Entrypoint overrides spec.entrypoint", - ) - generate_name: Optional[str] = Field( - default=None, - alias="generateName", - description="GenerateName overrides metadata.generateName", - ) - labels: Optional[str] = Field(default=None, description="Labels adds to metadata.labels") - name: Optional[str] = Field(default=None, description="Name overrides metadata.name") - owner_reference: Optional[v1_1.OwnerReference] = Field( - default=None, - alias="ownerReference", - description="OwnerReference creates a metadata.ownerReference", - ) - parameters: Optional[List[str]] = Field(default=None, description="Parameters passes input parameters to workflow") - pod_priority_class_name: Optional[str] = Field( - default=None, - alias="podPriorityClassName", - description="Set the podPriorityClassName of the workflow", - ) - priority: Optional[int] = Field( - default=None, - description=( - "Priority is used if controller is configured to process limited number of" - " workflows in parallel, higher priority workflows are processed first." - ), - ) - server_dry_run: Optional[bool] = Field( - default=None, - alias="serverDryRun", - description=("ServerDryRun validates the workflow on the server-side without creating it"), - ) - service_account: Optional[str] = Field( - default=None, - alias="serviceAccount", - description=("ServiceAccount runs all pods in the workflow using specified" " ServiceAccount."), - ) +class SynchronizationStatus(BaseModel): + mutex: Annotated[ + Optional[MutexStatus], + Field(description="Mutex stores this workflow's mutex holder details"), + ] = None + semaphore: Annotated[ + Optional[SemaphoreStatus], + Field(description="Semaphore stores this workflow's Semaphore holder details"), + ] = None -class Synchronization(BaseModel): - mutex: Optional[Mutex] = Field(default=None, description="Mutex holds the Mutex lock details") - semaphore: Optional[SemaphoreRef] = Field(default=None, description="Semaphore holds the Semaphore configuration") +class SubmitOpts(BaseModel): + annotations: Annotated[Optional[str], Field(description="Annotations adds to metadata.labels")] = None + dry_run: Annotated[ + Optional[bool], + Field( + alias="dryRun", + description=( + "DryRun validates the workflow on the client-side without creating it." + " This option is not supported in API" + ), + ), + ] = None + entry_point: Annotated[ + Optional[str], + Field(alias="entryPoint", description="Entrypoint overrides spec.entrypoint"), + ] = None + generate_name: Annotated[ + Optional[str], + Field( + alias="generateName", + description="GenerateName overrides metadata.generateName", + ), + ] = None + labels: Annotated[Optional[str], Field(description="Labels adds to metadata.labels")] = None + name: Annotated[Optional[str], Field(description="Name overrides metadata.name")] = None + owner_reference: Annotated[ + Optional[v1_1.OwnerReference], + Field( + alias="ownerReference", + description="OwnerReference creates a metadata.ownerReference", + ), + ] = None + parameters: Annotated[ + Optional[List[str]], + Field(description="Parameters passes input parameters to workflow"), + ] = None + pod_priority_class_name: Annotated[ + Optional[str], + Field( + alias="podPriorityClassName", + description="Set the podPriorityClassName of the workflow", + ), + ] = None + priority: Annotated[ + Optional[int], + Field( + description=( + "Priority is used if controller is configured to process limited number" + " of workflows in parallel, higher priority workflows are processed" + " first." + ) + ), + ] = None + server_dry_run: Annotated[ + Optional[bool], + Field( + alias="serverDryRun", + description=("ServerDryRun validates the workflow on the server-side without" " creating it"), + ), + ] = None + service_account: Annotated[ + Optional[str], + Field( + alias="serviceAccount", + description=("ServiceAccount runs all pods in the workflow using specified" " ServiceAccount."), + ), + ] = None class ValueFrom(BaseModel): - config_map_key_ref: Optional[v1.ConfigMapKeySelector] = Field( - default=None, - alias="configMapKeyRef", - description=("ConfigMapKeyRef is configmap selector for input parameter configuration"), - ) - default: Optional[str] = Field( - default=None, - description=( - "Default specifies a value to be used if retrieving the value from the" " specified source fails" - ), - ) - event: Optional[str] = Field( - default=None, - description=( - "Selector (https://github.com/antonmedv/expr) that is evaluated against the" - " event to get the value of the parameter. E.g. `payload.message`" - ), - ) - expression: Optional[str] = Field( - default=None, - description=("Expression, if defined, is evaluated to specify the value for the" " parameter"), - ) - jq_filter: Optional[str] = Field( - default=None, - alias="jqFilter", - description=("JQFilter expression against the resource object in resource templates"), - ) - json_path: Optional[str] = Field( - default=None, - alias="jsonPath", - description=("JSONPath of a resource to retrieve an output parameter value from in" " resource templates"), - ) - parameter: Optional[str] = Field( - default=None, - description=( - "Parameter reference to a step or dag task in which to retrieve an output" - " parameter value from (e.g. '{{steps.mystep.outputs.myparam}}')" - ), - ) - path: Optional[str] = Field( - default=None, - description=("Path in the container to retrieve an output parameter value from in" " container templates"), - ) - supplied: Optional[SuppliedValueFrom] = Field( - default=None, - description=("Supplied value to be filled in directly, either through the CLI, API, etc."), - ) + config_map_key_ref: Annotated[ + Optional[v1.ConfigMapKeySelector], + Field( + alias="configMapKeyRef", + description=("ConfigMapKeyRef is configmap selector for input parameter" " configuration"), + ), + ] = None + default: Annotated[ + Optional[str], + Field( + description=( + "Default specifies a value to be used if retrieving the value from the" " specified source fails" + ) + ), + ] = None + event: Annotated[ + Optional[str], + Field( + description=( + "Selector (https://github.com/antonmedv/expr) that is evaluated against" + " the event to get the value of the parameter. E.g. `payload.message`" + ) + ), + ] = None + expression: Annotated[ + Optional[str], + Field(description=("Expression, if defined, is evaluated to specify the value for the" " parameter")), + ] = None + jq_filter: Annotated[ + Optional[str], + Field( + alias="jqFilter", + description=("JQFilter expression against the resource object in resource templates"), + ), + ] = None + json_path: Annotated[ + Optional[str], + Field( + alias="jsonPath", + description=("JSONPath of a resource to retrieve an output parameter value from in" " resource templates"), + ), + ] = None + parameter: Annotated[ + Optional[str], + Field( + description=( + "Parameter reference to a step or dag task in which to retrieve an" + " output parameter value from (e.g. '{{steps.mystep.outputs.myparam}}')" + ) + ), + ] = None + path: Annotated[ + Optional[str], + Field( + description=("Path in the container to retrieve an output parameter value from in" " container templates") + ), + ] = None + supplied: Annotated[ + Optional[SuppliedValueFrom], + Field(description=("Supplied value to be filled in directly, either through the CLI, API," " etc.")), + ] = None -class WorkflowSubmitRequest(BaseModel): - namespace: Optional[str] = None - resource_kind: Optional[str] = Field(default=None, alias="resourceKind") - resource_name: Optional[str] = Field(default=None, alias="resourceName") - submit_options: Optional[SubmitOpts] = Field(default=None, alias="submitOptions") +class HTTPHeader(BaseModel): + name: str + value: Optional[str] = None + value_from: Annotated[Optional[HTTPHeaderSource], Field(alias="valueFrom")] = None class HTTPAuth(BaseModel): - basic_auth: Optional[BasicAuth] = Field(default=None, alias="basicAuth") - client_cert: Optional[ClientCertAuth] = Field(default=None, alias="clientCert") + basic_auth: Annotated[Optional[BasicAuth], Field(alias="basicAuth")] = None + client_cert: Annotated[Optional[ClientCertAuth], Field(alias="clientCert")] = None oauth2: Optional[OAuth2Auth] = None -class HTTPHeader(BaseModel): - name: str - value: Optional[str] = None - value_from: Optional[HTTPHeaderSource] = Field(default=None, alias="valueFrom") +class S3Artifact(BaseModel): + access_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accessKeySecret", + description=("AccessKeySecret is the secret selector to the bucket's access key"), + ), + ] = None + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + create_bucket_if_not_present: Annotated[ + Optional[CreateS3BucketOptions], + Field( + alias="createBucketIfNotPresent", + description=( + "CreateBucketIfNotPresent tells the driver to attempt to create the S3" + " bucket for output artifacts, if it doesn't exist. Setting Enabled" + " Encryption will apply either SSE-S3 to the bucket if KmsKeyId is not" + " set or SSE-KMS if it is." + ), + ), + ] = None + encryption_options: Annotated[Optional[S3EncryptionOptions], Field(alias="encryptionOptions")] = None + endpoint: Annotated[ + Optional[str], + Field(description="Endpoint is the hostname of the bucket endpoint"), + ] = None + insecure: Annotated[ + Optional[bool], + Field(description="Insecure will connect to the service with TLS"), + ] = None + key: Annotated[ + Optional[str], + Field(description="Key is the key in the bucket where the artifact resides"), + ] = None + region: Annotated[Optional[str], Field(description="Region contains the optional bucket region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + description=("RoleARN is the Amazon Resource Name (ARN) of the role to assume."), + ), + ] = None + secret_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="secretKeySecret", + description=("SecretKeySecret is the secret selector to the bucket's secret key"), + ), + ] = None + use_sdk_creds: Annotated[ + Optional[bool], + Field( + alias="useSDKCreds", + description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), + ), + ] = None -class Parameter(BaseModel): - default: Optional[str] = Field( - default=None, - description=("Default is the default value to use for an input parameter if a value was" " not supplied"), - ) - description: Optional[str] = Field(default=None, description="Description is the parameter description") - enum: Optional[List[str]] = Field( - default=None, - description=("Enum holds a list of string values to choose from, for the actual value of" " the parameter"), - ) - global_name: Optional[str] = Field( - default=None, - alias="globalName", - description=( - "GlobalName exports an output parameter to the global scope, making it" - " available as '{{io.argoproj.workflow.v1alpha1.outputs.parameters.XXXX}}" - " and in workflow.status.outputs.parameters" - ), - ) - name: str = Field(..., description="Name is the parameter name") - value: Optional[str] = Field( - default=None, - description=( - "Value is the literal value to use for the parameter. If specified in the" - " context of an input parameter, the value takes precedence over any passed" - " values" - ), - ) - value_from: Optional[ValueFrom] = Field( - default=None, - alias="valueFrom", - description="ValueFrom is the source for the output parameter's value", - ) +class S3ArtifactRepository(BaseModel): + access_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="accessKeySecret", + description=("AccessKeySecret is the secret selector to the bucket's access key"), + ), + ] = None + bucket: Annotated[Optional[str], Field(description="Bucket is the name of the bucket")] = None + create_bucket_if_not_present: Annotated[ + Optional[CreateS3BucketOptions], + Field( + alias="createBucketIfNotPresent", + description=( + "CreateBucketIfNotPresent tells the driver to attempt to create the S3" + " bucket for output artifacts, if it doesn't exist. Setting Enabled" + " Encryption will apply either SSE-S3 to the bucket if KmsKeyId is not" + " set or SSE-KMS if it is." + ), + ), + ] = None + encryption_options: Annotated[Optional[S3EncryptionOptions], Field(alias="encryptionOptions")] = None + endpoint: Annotated[ + Optional[str], + Field(description="Endpoint is the hostname of the bucket endpoint"), + ] = None + insecure: Annotated[ + Optional[bool], + Field(description="Insecure will connect to the service with TLS"), + ] = None + key_format: Annotated[ + Optional[str], + Field( + alias="keyFormat", + description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), + ), + ] = None + key_prefix: Annotated[ + Optional[str], + Field( + alias="keyPrefix", + description=( + "KeyPrefix is prefix used as part of the bucket key in which the" + " controller will store artifacts. DEPRECATED. Use KeyFormat instead" + ), + ), + ] = None + region: Annotated[Optional[str], Field(description="Region contains the optional bucket region")] = None + role_arn: Annotated[ + Optional[str], + Field( + alias="roleARN", + description=("RoleARN is the Amazon Resource Name (ARN) of the role to assume."), + ), + ] = None + secret_key_secret: Annotated[ + Optional[v1.SecretKeySelector], + Field( + alias="secretKeySecret", + description=("SecretKeySecret is the secret selector to the bucket's secret key"), + ), + ] = None + use_sdk_creds: Annotated[ + Optional[bool], + Field( + alias="useSDKCreds", + description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), + ), + ] = None -class PodGC(BaseModel): - label_selector: Optional[v1_1.LabelSelector] = Field( - default=None, - alias="labelSelector", - description=( - "LabelSelector is the label selector to check if the pods match the labels" - " before being added to the pod GC queue." - ), - ) - strategy: Optional[str] = Field( - default=None, - description=( - 'Strategy is the strategy to use. One of "OnPodCompletion", "OnPodSuccess",' - ' "OnWorkflowCompletion", "OnWorkflowSuccess"' +class Memoize(BaseModel): + cache: Annotated[Cache, Field(description="Cache sets and configures the kind of cache")] + key: Annotated[str, Field(description="Key is the key to use as the caching key")] + max_age: Annotated[ + str, + Field( + alias="maxAge", + description=( + 'MaxAge is the maximum age (e.g. "180s", "24h") of an entry that is' + " still considered valid. If an entry is older than the MaxAge, it will" + " be ignored." + ), ), - ) + ] -class S3Artifact(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKeySecret", - description="AccessKeySecret is the secret selector to the bucket's access key", - ) - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - create_bucket_if_not_present: Optional[CreateS3BucketOptions] = Field( - default=None, - alias="createBucketIfNotPresent", - description=( - "CreateBucketIfNotPresent tells the driver to attempt to create the S3" - " bucket for output artifacts, if it doesn't exist. Setting Enabled" - " Encryption will apply either SSE-S3 to the bucket if KmsKeyId is not set" - " or SSE-KMS if it is." - ), - ) - encryption_options: Optional[S3EncryptionOptions] = Field(default=None, alias="encryptionOptions") - endpoint: Optional[str] = Field(default=None, description="Endpoint is the hostname of the bucket endpoint") - insecure: Optional[bool] = Field(default=None, description="Insecure will connect to the service with TLS") - key: Optional[str] = Field( - default=None, - description="Key is the key in the bucket where the artifact resides", - ) - region: Optional[str] = Field(default=None, description="Region contains the optional bucket region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - description="RoleARN is the Amazon Resource Name (ARN) of the role to assume.", - ) - secret_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKeySecret", - description="SecretKeySecret is the secret selector to the bucket's secret key", - ) - use_sdk_creds: Optional[bool] = Field( - default=None, - alias="useSDKCreds", - description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), - ) +class Synchronization(BaseModel): + mutex: Annotated[Optional[Mutex], Field(description="Mutex holds the Mutex lock details")] = None + semaphore: Annotated[ + Optional[SemaphoreRef], + Field(description="Semaphore holds the Semaphore configuration"), + ] = None -class S3ArtifactRepository(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="accessKeySecret", - description="AccessKeySecret is the secret selector to the bucket's access key", - ) - bucket: Optional[str] = Field(default=None, description="Bucket is the name of the bucket") - create_bucket_if_not_present: Optional[CreateS3BucketOptions] = Field( - default=None, - alias="createBucketIfNotPresent", - description=( - "CreateBucketIfNotPresent tells the driver to attempt to create the S3" - " bucket for output artifacts, if it doesn't exist. Setting Enabled" - " Encryption will apply either SSE-S3 to the bucket if KmsKeyId is not set" - " or SSE-KMS if it is." - ), - ) - encryption_options: Optional[S3EncryptionOptions] = Field(default=None, alias="encryptionOptions") - endpoint: Optional[str] = Field(default=None, description="Endpoint is the hostname of the bucket endpoint") - insecure: Optional[bool] = Field(default=None, description="Insecure will connect to the service with TLS") - key_format: Optional[str] = Field( - default=None, - alias="keyFormat", - description=("KeyFormat is defines the format of how to store keys. Can reference" " workflow variables"), - ) - key_prefix: Optional[str] = Field( - default=None, - alias="keyPrefix", - description=( - "KeyPrefix is prefix used as part of the bucket key in which the controller" - " will store artifacts. DEPRECATED. Use KeyFormat instead" - ), - ) - region: Optional[str] = Field(default=None, description="Region contains the optional bucket region") - role_arn: Optional[str] = Field( - default=None, - alias="roleARN", - description="RoleARN is the Amazon Resource Name (ARN) of the role to assume.", - ) - secret_key_secret: Optional[v1.SecretKeySelector] = Field( - default=None, - alias="secretKeySecret", - description="SecretKeySecret is the secret selector to the bucket's secret key", - ) - use_sdk_creds: Optional[bool] = Field( - default=None, - alias="useSDKCreds", - description=("UseSDKCreds tells the driver to figure out credentials based on sdk" " defaults."), - ) +class RetryStrategy(BaseModel): + affinity: Annotated[ + Optional[RetryAffinity], + Field(description="Affinity prevents running workflow's step on the same host"), + ] = None + backoff: Annotated[Optional[Backoff], Field(description="Backoff is a backoff strategy")] = None + expression: Annotated[ + Optional[str], + Field( + description=( + "Expression is a condition expression for when a node will be retried." + " If it evaluates to false, the node will not be retried and the retry" + " strategy will be ignored" + ) + ), + ] = None + limit: Annotated[ + Optional[intstr.IntOrString], + Field( + description=( + "Limit is the maximum number of retry attempts when retrying a" + " container. It does not include the original container; the maximum" + " number of total attempts will be `limit + 1`." + ) + ), + ] = None + retry_policy: Annotated[ + Optional[str], + Field( + alias="retryPolicy", + description=("RetryPolicy is a policy of NodePhase statuses that will be retried"), + ), + ] = None -class ArtifactRepository(BaseModel): - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs enables log archiving", - ) - artifactory: Optional[ArtifactoryArtifactRepository] = Field( - default=None, description="Artifactory stores artifacts to JFrog Artifactory" - ) - azure: Optional[AzureArtifactRepository] = Field( - default=None, description="Azure stores artifact in an Azure Storage account" - ) - gcs: Optional[GCSArtifactRepository] = Field(default=None, description="GCS stores artifact in a GCS object store") - hdfs: Optional[HDFSArtifactRepository] = Field(default=None, description="HDFS stores artifacts in HDFS") - oss: Optional[OSSArtifactRepository] = Field( - default=None, description="OSS stores artifact in a OSS-compliant object store" - ) - s3: Optional[S3ArtifactRepository] = Field( - default=None, description="S3 stores artifact in a S3-compliant object store" - ) +class WorkflowSubmitRequest(BaseModel): + namespace: Optional[str] = None + resource_kind: Annotated[Optional[str], Field(alias="resourceKind")] = None + resource_name: Annotated[Optional[str], Field(alias="resourceName")] = None + submit_options: Annotated[Optional[SubmitOpts], Field(alias="submitOptions")] = None -class ArtifactRepositoryRefStatus(BaseModel): - artifact_repository: Optional[ArtifactRepository] = Field( - default=None, - alias="artifactRepository", - description=("The repository the workflow will use. This maybe empty before v3.1."), - ) - config_map: Optional[str] = Field( - default=None, - alias="configMap", - description='The name of the config map. Defaults to "artifact-repositories".', - ) - default: Optional[bool] = Field( - default=None, - description=("If this ref represents the default artifact repository, rather than a" " config map."), - ) - key: Optional[str] = Field( - default=None, - description=( - "The config map key. Defaults to the value of the" - ' "workflows.argoproj.io/default-artifact-repository" annotation.' - ), - ) - namespace: Optional[str] = Field( - default=None, - description=( - "The namespace of the config map. Defaults to the workflow's namespace, or" - " the controller's namespace (if found)." - ), - ) +class Parameter(BaseModel): + default: Annotated[ + Optional[str], + Field( + description=("Default is the default value to use for an input parameter if a value" " was not supplied") + ), + ] = None + description: Annotated[Optional[str], Field(description="Description is the parameter description")] = None + enum: Annotated[ + Optional[List[str]], + Field( + description=("Enum holds a list of string values to choose from, for the actual" " value of the parameter") + ), + ] = None + global_name: Annotated[ + Optional[str], + Field( + alias="globalName", + description=( + "GlobalName exports an output parameter to the global scope, making it" + " available as" + " '{{io.argoproj.workflow.v1alpha1.outputs.parameters.XXXX}} and in" + " workflow.status.outputs.parameters" + ), + ), + ] = None + name: Annotated[str, Field(description="Name is the parameter name")] + value: Annotated[ + Optional[str], + Field( + description=( + "Value is the literal value to use for the parameter. If specified in" + " the context of an input parameter, the value takes precedence over" + " any passed values" + ) + ), + ] = None + value_from: Annotated[ + Optional[ValueFrom], + Field( + alias="valueFrom", + description="ValueFrom is the source for the output parameter's value", + ), + ] = None -class HTTP(BaseModel): - body: Optional[str] = Field(default=None, description="Body is content of the HTTP Request") - body_from: Optional[HTTPBodySource] = Field( - default=None, - alias="bodyFrom", - description="BodyFrom is content of the HTTP Request as Bytes", - ) - headers: Optional[List[HTTPHeader]] = Field( - default=None, - description=("Headers are an optional list of headers to send with HTTP requests"), - ) - insecure_skip_verify: Optional[bool] = Field( - default=None, - alias="insecureSkipVerify", - description=( - "InsecureSkipVerify is a bool when if set to true will skip TLS" " verification for the HTTP client" - ), - ) - method: Optional[str] = Field(default=None, description="Method is HTTP methods for HTTP Request") - success_condition: Optional[str] = Field( - default=None, - alias="successCondition", - description=("SuccessCondition is an expression if evaluated to true is considered" " successful"), - ) - timeout_seconds: Optional[int] = Field( - default=None, - alias="timeoutSeconds", - description=("TimeoutSeconds is request timeout for HTTP Request. Default is 30 seconds"), - ) - url: str = Field(..., description="URL of the HTTP Request") +class HTTPArtifact(BaseModel): + auth: Annotated[ + Optional[HTTPAuth], + Field(description="Auth contains information for client authentication"), + ] = None + headers: Annotated[ + Optional[List[Header]], + Field(description=("Headers are an optional list of headers to send with HTTP requests for" " artifacts")), + ] = None + url: Annotated[str, Field(description="URL of the artifact")] -class HTTPArtifact(BaseModel): - auth: Optional[HTTPAuth] = Field(default=None, description="Auth contains information for client authentication") - headers: Optional[List[Header]] = Field( - default=None, - description=("Headers are an optional list of headers to send with HTTP requests for" " artifacts"), - ) - url: str = Field(..., description="URL of the artifact") +class ArtifactRepository(BaseModel): + archive_logs: Annotated[ + Optional[bool], + Field(alias="archiveLogs", description="ArchiveLogs enables log archiving"), + ] = None + artifactory: Annotated[ + Optional[ArtifactoryArtifactRepository], + Field(description="Artifactory stores artifacts to JFrog Artifactory"), + ] = None + azure: Annotated[ + Optional[AzureArtifactRepository], + Field(description="Azure stores artifact in an Azure Storage account"), + ] = None + gcs: Annotated[ + Optional[GCSArtifactRepository], + Field(description="GCS stores artifact in a GCS object store"), + ] = None + hdfs: Annotated[ + Optional[HDFSArtifactRepository], + Field(description="HDFS stores artifacts in HDFS"), + ] = None + oss: Annotated[ + Optional[OSSArtifactRepository], + Field(description="OSS stores artifact in a OSS-compliant object store"), + ] = None + s3: Annotated[ + Optional[S3ArtifactRepository], + Field(description="S3 stores artifact in a S3-compliant object store"), + ] = None class Artifact(BaseModel): - archive: Optional[ArchiveStrategy] = Field( - default=None, - description=("Archive controls how the artifact will be saved to the artifact" " repository."), - ) - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs indicates if the container logs should be archived", - ) - artifact_gc: Optional[ArtifactGC] = Field( - default=None, - alias="artifactGC", - description=( - "ArtifactGC describes the strategy to use when to deleting an artifact from" - " completed or deleted workflows" - ), - ) - artifactory: Optional[ArtifactoryArtifact] = Field( - default=None, - description="Artifactory contains artifactory artifact location details", - ) - azure: Optional[AzureArtifact] = Field( - default=None, - description="Azure contains Azure Storage artifact location details", - ) - deleted: Optional[bool] = Field(default=None, description="Has this been deleted?") - from_: Optional[str] = Field( - default=None, - alias="from", - description=("From allows an artifact to reference an artifact from a previous step"), - ) - from_expression: Optional[str] = Field( - default=None, - alias="fromExpression", - description=("FromExpression, if defined, is evaluated to specify the value for the" " artifact"), - ) - gcs: Optional[GCSArtifact] = Field(default=None, description="GCS contains GCS artifact location details") - git: Optional[GitArtifact] = Field(default=None, description="Git contains git artifact location details") - global_name: Optional[str] = Field( - default=None, - alias="globalName", - description=( - "GlobalName exports an output artifact to the global scope, making it" - " available as '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}}" - " and in workflow.status.outputs.artifacts" - ), - ) - hdfs: Optional[HDFSArtifact] = Field(default=None, description="HDFS contains HDFS artifact location details") - http: Optional[HTTPArtifact] = Field(default=None, description="HTTP contains HTTP artifact location details") - mode: Optional[int] = Field( - default=None, - description=( - "mode bits to use on this file, must be a value between 0 and 0777 set when" " loading input artifacts." - ), - ) - name: str = Field( - ..., - description=("name of the artifact. must be unique within a template's inputs/outputs."), - ) - optional: Optional[bool] = Field( - default=None, - description="Make Artifacts optional, if Artifacts doesn't generate or exist", - ) - oss: Optional[OSSArtifact] = Field(default=None, description="OSS contains OSS artifact location details") - path: Optional[str] = Field(default=None, description="Path is the container path to the artifact") - raw: Optional[RawArtifact] = Field(default=None, description="Raw contains raw artifact location details") - recurse_mode: Optional[bool] = Field( - default=None, - alias="recurseMode", - description=("If mode is set, apply the permission recursively into the artifact if it" " is a folder"), - ) - s3: Optional[S3Artifact] = Field(default=None, description="S3 contains S3 artifact location details") - sub_path: Optional[str] = Field( - default=None, - alias="subPath", - description=("SubPath allows an artifact to be sourced from a subpath within the" " specified source"), - ) + archive: Annotated[ + Optional[ArchiveStrategy], + Field(description=("Archive controls how the artifact will be saved to the artifact" " repository.")), + ] = None + archive_logs: Annotated[ + Optional[bool], + Field( + alias="archiveLogs", + description=("ArchiveLogs indicates if the container logs should be archived"), + ), + ] = None + artifact_gc: Annotated[ + Optional[ArtifactGC], + Field( + alias="artifactGC", + description=( + "ArtifactGC describes the strategy to use when to deleting an artifact" + " from completed or deleted workflows" + ), + ), + ] = None + artifactory: Annotated[ + Optional[ArtifactoryArtifact], + Field(description="Artifactory contains artifactory artifact location details"), + ] = None + azure: Annotated[ + Optional[AzureArtifact], + Field(description="Azure contains Azure Storage artifact location details"), + ] = None + deleted: Annotated[Optional[bool], Field(description="Has this been deleted?")] = None + from_: Annotated[ + Optional[str], + Field( + alias="from", + description=("From allows an artifact to reference an artifact from a previous step"), + ), + ] = None + from_expression: Annotated[ + Optional[str], + Field( + alias="fromExpression", + description=("FromExpression, if defined, is evaluated to specify the value for the" " artifact"), + ), + ] = None + gcs: Annotated[ + Optional[GCSArtifact], + Field(description="GCS contains GCS artifact location details"), + ] = None + git: Annotated[ + Optional[GitArtifact], + Field(description="Git contains git artifact location details"), + ] = None + global_name: Annotated[ + Optional[str], + Field( + alias="globalName", + description=( + "GlobalName exports an output artifact to the global scope, making it" + " available as" + " '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}} and in" + " workflow.status.outputs.artifacts" + ), + ), + ] = None + hdfs: Annotated[ + Optional[HDFSArtifact], + Field(description="HDFS contains HDFS artifact location details"), + ] = None + http: Annotated[ + Optional[HTTPArtifact], + Field(description="HTTP contains HTTP artifact location details"), + ] = None + mode: Annotated[ + Optional[int], + Field( + description=( + "mode bits to use on this file, must be a value between 0 and 0777 set" + " when loading input artifacts." + ) + ), + ] = None + name: Annotated[ + str, + Field(description=("name of the artifact. must be unique within a template's" " inputs/outputs.")), + ] + optional: Annotated[ + Optional[bool], + Field(description=("Make Artifacts optional, if Artifacts doesn't generate or exist")), + ] = None + oss: Annotated[ + Optional[OSSArtifact], + Field(description="OSS contains OSS artifact location details"), + ] = None + path: Annotated[Optional[str], Field(description="Path is the container path to the artifact")] = None + raw: Annotated[ + Optional[RawArtifact], + Field(description="Raw contains raw artifact location details"), + ] = None + recurse_mode: Annotated[ + Optional[bool], + Field( + alias="recurseMode", + description=("If mode is set, apply the permission recursively into the artifact if" " it is a folder"), + ), + ] = None + s3: Annotated[ + Optional[S3Artifact], + Field(description="S3 contains S3 artifact location details"), + ] = None + sub_path: Annotated[ + Optional[str], + Field( + alias="subPath", + description=("SubPath allows an artifact to be sourced from a subpath within the" " specified source"), + ), + ] = None class ArtifactLocation(BaseModel): - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs indicates if the container logs should be archived", - ) - artifactory: Optional[ArtifactoryArtifact] = Field( - default=None, - description="Artifactory contains artifactory artifact location details", - ) - azure: Optional[AzureArtifact] = Field( - default=None, - description="Azure contains Azure Storage artifact location details", - ) - gcs: Optional[GCSArtifact] = Field(default=None, description="GCS contains GCS artifact location details") - git: Optional[GitArtifact] = Field(default=None, description="Git contains git artifact location details") - hdfs: Optional[HDFSArtifact] = Field(default=None, description="HDFS contains HDFS artifact location details") - http: Optional[HTTPArtifact] = Field(default=None, description="HTTP contains HTTP artifact location details") - oss: Optional[OSSArtifact] = Field(default=None, description="OSS contains OSS artifact location details") - raw: Optional[RawArtifact] = Field(default=None, description="Raw contains raw artifact location details") - s3: Optional[S3Artifact] = Field(default=None, description="S3 contains S3 artifact location details") + archive_logs: Annotated[ + Optional[bool], + Field( + alias="archiveLogs", + description=("ArchiveLogs indicates if the container logs should be archived"), + ), + ] = None + artifactory: Annotated[ + Optional[ArtifactoryArtifact], + Field(description="Artifactory contains artifactory artifact location details"), + ] = None + azure: Annotated[ + Optional[AzureArtifact], + Field(description="Azure contains Azure Storage artifact location details"), + ] = None + gcs: Annotated[ + Optional[GCSArtifact], + Field(description="GCS contains GCS artifact location details"), + ] = None + git: Annotated[ + Optional[GitArtifact], + Field(description="Git contains git artifact location details"), + ] = None + hdfs: Annotated[ + Optional[HDFSArtifact], + Field(description="HDFS contains HDFS artifact location details"), + ] = None + http: Annotated[ + Optional[HTTPArtifact], + Field(description="HTTP contains HTTP artifact location details"), + ] = None + oss: Annotated[ + Optional[OSSArtifact], + Field(description="OSS contains OSS artifact location details"), + ] = None + raw: Annotated[ + Optional[RawArtifact], + Field(description="Raw contains raw artifact location details"), + ] = None + s3: Annotated[ + Optional[S3Artifact], + Field(description="S3 contains S3 artifact location details"), + ] = None -class ArtifactNodeSpec(BaseModel): - archive_location: Optional[ArtifactLocation] = Field( - default=None, - alias="archiveLocation", - description=("ArchiveLocation is the template-level Artifact location specification"), - ) - artifacts: Optional[Dict[str, Artifact]] = Field( - default=None, description="Artifacts maps artifact name to Artifact description" - ) +class ArtifactPaths(BaseModel): + archive: Annotated[ + Optional[ArchiveStrategy], + Field(description=("Archive controls how the artifact will be saved to the artifact" " repository.")), + ] = None + archive_logs: Annotated[ + Optional[bool], + Field( + alias="archiveLogs", + description=("ArchiveLogs indicates if the container logs should be archived"), + ), + ] = None + artifact_gc: Annotated[ + Optional[ArtifactGC], + Field( + alias="artifactGC", + description=( + "ArtifactGC describes the strategy to use when to deleting an artifact" + " from completed or deleted workflows" + ), + ), + ] = None + artifactory: Annotated[ + Optional[ArtifactoryArtifact], + Field(description="Artifactory contains artifactory artifact location details"), + ] = None + azure: Annotated[ + Optional[AzureArtifact], + Field(description="Azure contains Azure Storage artifact location details"), + ] = None + deleted: Annotated[Optional[bool], Field(description="Has this been deleted?")] = None + from_: Annotated[ + Optional[str], + Field( + alias="from", + description=("From allows an artifact to reference an artifact from a previous step"), + ), + ] = None + from_expression: Annotated[ + Optional[str], + Field( + alias="fromExpression", + description=("FromExpression, if defined, is evaluated to specify the value for the" " artifact"), + ), + ] = None + gcs: Annotated[ + Optional[GCSArtifact], + Field(description="GCS contains GCS artifact location details"), + ] = None + git: Annotated[ + Optional[GitArtifact], + Field(description="Git contains git artifact location details"), + ] = None + global_name: Annotated[ + Optional[str], + Field( + alias="globalName", + description=( + "GlobalName exports an output artifact to the global scope, making it" + " available as" + " '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}} and in" + " workflow.status.outputs.artifacts" + ), + ), + ] = None + hdfs: Annotated[ + Optional[HDFSArtifact], + Field(description="HDFS contains HDFS artifact location details"), + ] = None + http: Annotated[ + Optional[HTTPArtifact], + Field(description="HTTP contains HTTP artifact location details"), + ] = None + mode: Annotated[ + Optional[int], + Field( + description=( + "mode bits to use on this file, must be a value between 0 and 0777 set" + " when loading input artifacts." + ) + ), + ] = None + name: Annotated[ + str, + Field(description=("name of the artifact. must be unique within a template's" " inputs/outputs.")), + ] + optional: Annotated[ + Optional[bool], + Field(description=("Make Artifacts optional, if Artifacts doesn't generate or exist")), + ] = None + oss: Annotated[ + Optional[OSSArtifact], + Field(description="OSS contains OSS artifact location details"), + ] = None + path: Annotated[Optional[str], Field(description="Path is the container path to the artifact")] = None + raw: Annotated[ + Optional[RawArtifact], + Field(description="Raw contains raw artifact location details"), + ] = None + recurse_mode: Annotated[ + Optional[bool], + Field( + alias="recurseMode", + description=("If mode is set, apply the permission recursively into the artifact if" " it is a folder"), + ), + ] = None + s3: Annotated[ + Optional[S3Artifact], + Field(description="S3 contains S3 artifact location details"), + ] = None + sub_path: Annotated[ + Optional[str], + Field( + alias="subPath", + description=("SubPath allows an artifact to be sourced from a subpath within the" " specified source"), + ), + ] = None -class ArtifactPaths(BaseModel): - archive: Optional[ArchiveStrategy] = Field( - default=None, - description=("Archive controls how the artifact will be saved to the artifact" " repository."), - ) - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs indicates if the container logs should be archived", - ) - artifact_gc: Optional[ArtifactGC] = Field( - default=None, - alias="artifactGC", - description=( - "ArtifactGC describes the strategy to use when to deleting an artifact from" - " completed or deleted workflows" - ), - ) - artifactory: Optional[ArtifactoryArtifact] = Field( - default=None, - description="Artifactory contains artifactory artifact location details", - ) - azure: Optional[AzureArtifact] = Field( - default=None, - description="Azure contains Azure Storage artifact location details", - ) - deleted: Optional[bool] = Field(default=None, description="Has this been deleted?") - from_: Optional[str] = Field( - default=None, - alias="from", - description=("From allows an artifact to reference an artifact from a previous step"), - ) - from_expression: Optional[str] = Field( - default=None, - alias="fromExpression", - description=("FromExpression, if defined, is evaluated to specify the value for the" " artifact"), - ) - gcs: Optional[GCSArtifact] = Field(default=None, description="GCS contains GCS artifact location details") - git: Optional[GitArtifact] = Field(default=None, description="Git contains git artifact location details") - global_name: Optional[str] = Field( - default=None, - alias="globalName", - description=( - "GlobalName exports an output artifact to the global scope, making it" - " available as '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}}" - " and in workflow.status.outputs.artifacts" - ), - ) - hdfs: Optional[HDFSArtifact] = Field(default=None, description="HDFS contains HDFS artifact location details") - http: Optional[HTTPArtifact] = Field(default=None, description="HTTP contains HTTP artifact location details") - mode: Optional[int] = Field( - default=None, - description=( - "mode bits to use on this file, must be a value between 0 and 0777 set when" " loading input artifacts." - ), - ) - name: str = Field( - ..., - description=("name of the artifact. must be unique within a template's inputs/outputs."), - ) - optional: Optional[bool] = Field( - default=None, - description="Make Artifacts optional, if Artifacts doesn't generate or exist", - ) - oss: Optional[OSSArtifact] = Field(default=None, description="OSS contains OSS artifact location details") - path: Optional[str] = Field(default=None, description="Path is the container path to the artifact") - raw: Optional[RawArtifact] = Field(default=None, description="Raw contains raw artifact location details") - recurse_mode: Optional[bool] = Field( - default=None, - alias="recurseMode", - description=("If mode is set, apply the permission recursively into the artifact if it" " is a folder"), - ) - s3: Optional[S3Artifact] = Field(default=None, description="S3 contains S3 artifact location details") - sub_path: Optional[str] = Field( - default=None, - alias="subPath", - description=("SubPath allows an artifact to be sourced from a subpath within the" " specified source"), - ) +class ArtifactRepositoryRefStatus(BaseModel): + artifact_repository: Annotated[ + Optional[ArtifactRepository], + Field( + alias="artifactRepository", + description=("The repository the workflow will use. This maybe empty before v3.1."), + ), + ] = None + config_map: Annotated[ + Optional[str], + Field( + alias="configMap", + description=('The name of the config map. Defaults to "artifact-repositories".'), + ), + ] = None + default: Annotated[ + Optional[bool], + Field(description=("If this ref represents the default artifact repository, rather than a" " config map.")), + ] = None + key: Annotated[ + Optional[str], + Field( + description=( + "The config map key. Defaults to the value of the" + ' "workflows.argoproj.io/default-artifact-repository" annotation.' + ) + ), + ] = None + namespace: Annotated[ + Optional[str], + Field( + description=( + "The namespace of the config map. Defaults to the workflow's namespace," + " or the controller's namespace (if found)." + ) + ), + ] = None -class ContainerNode(BaseModel): - args: Optional[List[str]] = Field( - default=None, - description=( - "Arguments to the entrypoint. The container image's CMD is used if this is" - " not provided. Variable references $(VAR_NAME) are expanded using the" - " container's environment. If a variable cannot be resolved, the reference" - " in the input string will be unchanged. Double $$ are reduced to a single" - ' $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)"' - ' will produce the string literal "$(VAR_NAME)". Escaped references will' - " never be expanded, regardless of whether the variable exists or not." - " Cannot be updated. More info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - command: Optional[List[str]] = Field( - default=None, - description=( - "Entrypoint array. Not executed within a shell. The container image's" - " ENTRYPOINT is used if this is not provided. Variable references" - " $(VAR_NAME) are expanded using the container's environment. If a" - " variable cannot be resolved, the reference in the input string will be" - " unchanged. Double $$ are reduced to a single $, which allows for escaping" - ' the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string' - ' literal "$(VAR_NAME)". Escaped references will never be expanded,' - " regardless of whether the variable exists or not. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - dependencies: Optional[List[str]] = None - env: Optional[List[v1.EnvVar]] = Field( - default=None, - description=("List of environment variables to set in the container. Cannot be updated."), - ) - env_from: Optional[List[v1.EnvFromSource]] = Field( - default=None, - alias="envFrom", - description=( - "List of sources to populate environment variables in the container. The" - " keys defined within a source must be a C_IDENTIFIER. All invalid keys" - " will be reported as an event when the container is starting. When a key" - " exists in multiple sources, the value associated with the last source" - " will take precedence. Values defined by an Env with a duplicate key will" - " take precedence. Cannot be updated." - ), - ) - image: Optional[str] = Field( - default=None, - description=( - "Container image name. More info:" - " https://kubernetes.io/docs/concepts/containers/images This field is" - " optional to allow higher level config management to default or override" - " container images in workload controllers like Deployments and" - " StatefulSets." - ), - ) - image_pull_policy: Optional[str] = Field( - default=None, - alias="imagePullPolicy", - description=( - "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always" - " if :latest tag is specified, or IfNotPresent otherwise. Cannot be" - " updated. More info:" - " https://kubernetes.io/docs/concepts/containers/images#updating-images" - ), - ) - lifecycle: Optional[v1.Lifecycle] = Field( - default=None, - description=( - "Actions that the management system should take in response to container" - " lifecycle events. Cannot be updated." - ), - ) - liveness_probe: Optional[v1.Probe] = Field( - default=None, - alias="livenessProbe", - description=( - "Periodic probe of container liveness. Container will be restarted if the" - " probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - name: str = Field( - ..., - description=( - "Name of the container specified as a DNS_LABEL. Each container in a pod" - " must have a unique name (DNS_LABEL). Cannot be updated." - ), - ) - ports: Optional[List[v1.ContainerPort]] = Field( - default=None, - description=( - "List of ports to expose from the container. Exposing a port here gives the" - " system additional information about the network connections a container" - " uses, but is primarily informational. Not specifying a port here DOES NOT" - " prevent that port from being exposed. Any port which is listening on the" - ' default "0.0.0.0" address inside a container will be accessible from the' - " network. Cannot be updated." - ), - ) - readiness_probe: Optional[v1.Probe] = Field( - default=None, - alias="readinessProbe", - description=( - "Periodic probe of container service readiness. Container will be removed" - " from service endpoints if the probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - resources: Optional[v1.ResourceRequirements] = Field( - default=None, - description=( - "Compute Resources required by this container. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - security_context: Optional[v1.SecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext defines the security options the container should be run" - " with. If set, the fields of SecurityContext override the equivalent" - " fields of PodSecurityContext. More info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" - ), - ) - startup_probe: Optional[v1.Probe] = Field( - default=None, - alias="startupProbe", - description=( - "StartupProbe indicates that the Pod has successfully initialized. If" - " specified, no other probes are executed until this completes" - " successfully. If this probe fails, the Pod will be restarted, just as if" - " the livenessProbe failed. This can be used to provide different probe" - " parameters at the beginning of a Pod's lifecycle, when it might take a" - " long time to load data or warm a cache, than during steady-state" - " operation. This cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - stdin: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a buffer for stdin in the container" - " runtime. If this is not set, reads from stdin in the container will" - " always result in EOF. Default is false." - ), - ) - stdin_once: Optional[bool] = Field( - default=None, - alias="stdinOnce", - description=( - "Whether the container runtime should close the stdin channel after it has" - " been opened by a single attach. When stdin is true the stdin stream will" - " remain open across multiple attach sessions. If stdinOnce is set to true," - " stdin is opened on container start, is empty until the first client" - " attaches to stdin, and then remains open and accepts data until the" - " client disconnects, at which time stdin is closed and remains closed" - " until the container is restarted. If this flag is false, a container" - " processes that reads from stdin will never receive an EOF. Default is" - " false" - ), - ) - termination_message_path: Optional[str] = Field( - default=None, - alias="terminationMessagePath", - description=( - "Optional: Path at which the file to which the container's termination" - " message will be written is mounted into the container's filesystem." - " Message written is intended to be brief final status, such as an" - " assertion failure message. Will be truncated by the node if greater than" - " 4096 bytes. The total message length across all containers will be" - " limited to 12kb. Defaults to /dev/termination-log. Cannot be updated." - ), - ) - termination_message_policy: Optional[str] = Field( - default=None, - alias="terminationMessagePolicy", - description=( - "Indicate how the termination message should be populated. File will use" - " the contents of terminationMessagePath to populate the container status" - " message on both success and failure. FallbackToLogsOnError will use the" - " last chunk of container log output if the termination message file is" - " empty and the container exited with an error. The log output is limited" - " to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot" - " be updated." - ), - ) - tty: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a TTY for itself, also requires" - " 'stdin' to be true. Default is false." - ), - ) - volume_devices: Optional[List[v1.VolumeDevice]] = Field( - default=None, - alias="volumeDevices", - description=("volumeDevices is the list of block devices to be used by the container."), - ) - volume_mounts: Optional[List[v1.VolumeMount]] = Field( - default=None, - alias="volumeMounts", - description=("Pod volumes to mount into the container's filesystem. Cannot be updated."), - ) - working_dir: Optional[str] = Field( - default=None, - alias="workingDir", - description=( - "Container's working directory. If not specified, the container runtime's" - " default will be used, which might be configured in the container image." - " Cannot be updated." - ), - ) +class ManifestFrom(BaseModel): + artifact: Annotated[Artifact, Field(description="Artifact contains the artifact to use")] -class ContainerSetTemplate(BaseModel): - containers: List[ContainerNode] - retry_strategy: Optional[ContainerSetRetryStrategy] = Field( - default=None, - alias="retryStrategy", - description=( - "RetryStrategy describes how to retry a container nodes in the container" - " set if it fails. Nbr of retries(default 0) and sleep duration between" - " retries(default 0s, instant retry) can be set." +class ArtifactNodeSpec(BaseModel): + archive_location: Annotated[ + Optional[ArtifactLocation], + Field( + alias="archiveLocation", + description=("ArchiveLocation is the template-level Artifact location specification"), ), - ) - volume_mounts: Optional[List[v1.VolumeMount]] = Field(default=None, alias="volumeMounts") + ] = None + artifacts: Annotated[ + Optional[Dict[str, Artifact]], + Field(description="Artifacts maps artifact name to Artifact description"), + ] = None class DataSource(BaseModel): - artifact_paths: Optional[ArtifactPaths] = Field( - default=None, - alias="artifactPaths", - description=("ArtifactPaths is a data transformation that collects a list of artifact" " paths"), - ) + artifact_paths: Annotated[ + Optional[ArtifactPaths], + Field( + alias="artifactPaths", + description=("ArtifactPaths is a data transformation that collects a list of" " artifact paths"), + ), + ] = None -class Inputs(BaseModel): - artifacts: Optional[List[Artifact]] = Field( - default=None, description="Artifact are a list of artifacts passed as inputs" - ) - parameters: Optional[List[Parameter]] = Field( - default=None, description="Parameters are a list of parameters passed as inputs" - ) +class ResourceTemplate(BaseModel): + action: Annotated[ + str, + Field( + description=( + "Action is the action to perform to the resource. Must be one of: get," + " create, apply, delete, replace, patch" + ) + ), + ] + failure_condition: Annotated[ + Optional[str], + Field( + alias="failureCondition", + description=( + "FailureCondition is a label selector expression which describes the" + " conditions of the k8s resource in which the step was considered" + " failed" + ), + ), + ] = None + flags: Annotated[ + Optional[List[str]], + Field( + description=( + "Flags is a set of additional options passed to kubectl before" + " submitting a resource I.e. to disable resource validation: flags:" + ' [\n\t"--validate=false" # disable resource validation\n]' + ) + ), + ] = None + manifest: Annotated[Optional[str], Field(description="Manifest contains the kubernetes manifest")] = None + manifest_from: Annotated[ + Optional[ManifestFrom], + Field( + alias="manifestFrom", + description="ManifestFrom is the source for a single kubernetes manifest", + ), + ] = None + merge_strategy: Annotated[ + Optional[str], + Field( + alias="mergeStrategy", + description=( + "MergeStrategy is the strategy used to merge a patch. It defaults to" + ' "strategic" Must be one of: strategic, merge, json' + ), + ), + ] = None + set_owner_reference: Annotated[ + Optional[bool], + Field( + alias="setOwnerReference", + description=( + "SetOwnerReference sets the reference to the workflow on the" " OwnerReference of generated resource." + ), + ), + ] = None + success_condition: Annotated[ + Optional[str], + Field( + alias="successCondition", + description=( + "SuccessCondition is a label selector expression which describes the" + " conditions of the k8s resource in which it is acceptable to proceed" + " to the following step" + ), + ), + ] = None -class ManifestFrom(BaseModel): - artifact: Artifact = Field(..., description="Artifact contains the artifact to use") +class Data(BaseModel): + source: Annotated[ + DataSource, + Field(description="Source sources external data into a data template"), + ] + transformation: Annotated[ + List[TransformationStep], + Field(description="Transformation applies a set of transformations"), + ] -class Outputs(BaseModel): - artifacts: Optional[List[Artifact]] = Field( - default=None, - description="Artifacts holds the list of output artifacts produced by a step", - ) - exit_code: Optional[str] = Field( - default=None, - alias="exitCode", - description="ExitCode holds the exit code of a script template", - ) - parameters: Optional[List[Parameter]] = Field( - default=None, - description="Parameters holds the list of output parameters produced by a step", - ) - result: Optional[str] = Field( - default=None, - description="Result holds the result (stdout) of a script template", - ) +class Arguments(BaseModel): + artifacts: Annotated[ + Optional[List[Artifact]], + Field(description=("Artifacts is the list of artifacts to pass to the template or workflow")), + ] = None + parameters: Annotated[ + Optional[List[Parameter]], + Field(description=("Parameters is the list of parameters to pass to the template or" " workflow")), + ] = None -class ResourceTemplate(BaseModel): - action: str = Field( - ..., - description=( - "Action is the action to perform to the resource. Must be one of: get," - " create, apply, delete, replace, patch" - ), - ) - failure_condition: Optional[str] = Field( - default=None, - alias="failureCondition", - description=( - "FailureCondition is a label selector expression which describes the" - " conditions of the k8s resource in which the step was considered failed" - ), - ) - flags: Optional[List[str]] = Field( - default=None, - description=( - "Flags is a set of additional options passed to kubectl before submitting a" - " resource I.e. to disable resource validation: flags:" - ' [\n\t"--validate=false" # disable resource validation\n]' - ), - ) - manifest: Optional[str] = Field(default=None, description="Manifest contains the kubernetes manifest") - manifest_from: Optional[ManifestFrom] = Field( - default=None, - alias="manifestFrom", - description="ManifestFrom is the source for a single kubernetes manifest", - ) - merge_strategy: Optional[str] = Field( - default=None, - alias="mergeStrategy", - description=( - "MergeStrategy is the strategy used to merge a patch. It defaults to" - ' "strategic" Must be one of: strategic, merge, json' - ), - ) - set_owner_reference: Optional[bool] = Field( - default=None, - alias="setOwnerReference", - description=( - "SetOwnerReference sets the reference to the workflow on the OwnerReference" " of generated resource." - ), - ) - success_condition: Optional[str] = Field( - default=None, - alias="successCondition", - description=( - "SuccessCondition is a label selector expression which describes the" - " conditions of the k8s resource in which it is acceptable to proceed to" - " the following step" - ), - ) +class ArtifactGCSpec(BaseModel): + artifacts_by_node: Annotated[ + Optional[Dict[str, ArtifactNodeSpec]], + Field( + alias="artifactsByNode", + description=("ArtifactsByNode maps Node name to information pertaining to Artifacts" " on that Node"), + ), + ] = None -class ScriptTemplate(BaseModel): - args: Optional[List[str]] = Field( - default=None, - description=( - "Arguments to the entrypoint. The container image's CMD is used if this is" - " not provided. Variable references $(VAR_NAME) are expanded using the" - " container's environment. If a variable cannot be resolved, the reference" - " in the input string will be unchanged. Double $$ are reduced to a single" - ' $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)"' - ' will produce the string literal "$(VAR_NAME)". Escaped references will' - " never be expanded, regardless of whether the variable exists or not." - " Cannot be updated. More info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - command: Optional[List[str]] = Field( - default=None, - description=( - "Entrypoint array. Not executed within a shell. The container image's" - " ENTRYPOINT is used if this is not provided. Variable references" - " $(VAR_NAME) are expanded using the container's environment. If a" - " variable cannot be resolved, the reference in the input string will be" - " unchanged. Double $$ are reduced to a single $, which allows for escaping" - ' the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string' - ' literal "$(VAR_NAME)". Escaped references will never be expanded,' - " regardless of whether the variable exists or not. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - env: Optional[List[v1.EnvVar]] = Field( - default=None, - description=("List of environment variables to set in the container. Cannot be updated."), - ) - env_from: Optional[List[v1.EnvFromSource]] = Field( - default=None, - alias="envFrom", - description=( - "List of sources to populate environment variables in the container. The" - " keys defined within a source must be a C_IDENTIFIER. All invalid keys" - " will be reported as an event when the container is starting. When a key" - " exists in multiple sources, the value associated with the last source" - " will take precedence. Values defined by an Env with a duplicate key will" - " take precedence. Cannot be updated." - ), - ) - image: str = Field( - ..., - description=( - "Container image name. More info:" - " https://kubernetes.io/docs/concepts/containers/images This field is" - " optional to allow higher level config management to default or override" - " container images in workload controllers like Deployments and" - " StatefulSets." - ), - ) - image_pull_policy: Optional[str] = Field( - default=None, - alias="imagePullPolicy", - description=( - "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always" - " if :latest tag is specified, or IfNotPresent otherwise. Cannot be" - " updated. More info:" - " https://kubernetes.io/docs/concepts/containers/images#updating-images" - ), - ) - lifecycle: Optional[v1.Lifecycle] = Field( - default=None, - description=( - "Actions that the management system should take in response to container" - " lifecycle events. Cannot be updated." - ), - ) - liveness_probe: Optional[v1.Probe] = Field( - default=None, - alias="livenessProbe", - description=( - "Periodic probe of container liveness. Container will be restarted if the" - " probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the container specified as a DNS_LABEL. Each container in a pod" - " must have a unique name (DNS_LABEL). Cannot be updated." - ), - ) - ports: Optional[List[v1.ContainerPort]] = Field( - default=None, - description=( - "List of ports to expose from the container. Exposing a port here gives the" - " system additional information about the network connections a container" - " uses, but is primarily informational. Not specifying a port here DOES NOT" - " prevent that port from being exposed. Any port which is listening on the" - ' default "0.0.0.0" address inside a container will be accessible from the' - " network. Cannot be updated." - ), - ) - readiness_probe: Optional[v1.Probe] = Field( - default=None, - alias="readinessProbe", - description=( - "Periodic probe of container service readiness. Container will be removed" - " from service endpoints if the probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - resources: Optional[v1.ResourceRequirements] = Field( - default=None, - description=( - "Compute Resources required by this container. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - security_context: Optional[v1.SecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext defines the security options the container should be run" - " with. If set, the fields of SecurityContext override the equivalent" - " fields of PodSecurityContext. More info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" - ), - ) - source: str = Field(..., description="Source contains the source code of the script to execute") - startup_probe: Optional[v1.Probe] = Field( - default=None, - alias="startupProbe", - description=( - "StartupProbe indicates that the Pod has successfully initialized. If" - " specified, no other probes are executed until this completes" - " successfully. If this probe fails, the Pod will be restarted, just as if" - " the livenessProbe failed. This can be used to provide different probe" - " parameters at the beginning of a Pod's lifecycle, when it might take a" - " long time to load data or warm a cache, than during steady-state" - " operation. This cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - stdin: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a buffer for stdin in the container" - " runtime. If this is not set, reads from stdin in the container will" - " always result in EOF. Default is false." - ), - ) - stdin_once: Optional[bool] = Field( - default=None, - alias="stdinOnce", - description=( - "Whether the container runtime should close the stdin channel after it has" - " been opened by a single attach. When stdin is true the stdin stream will" - " remain open across multiple attach sessions. If stdinOnce is set to true," - " stdin is opened on container start, is empty until the first client" - " attaches to stdin, and then remains open and accepts data until the" - " client disconnects, at which time stdin is closed and remains closed" - " until the container is restarted. If this flag is false, a container" - " processes that reads from stdin will never receive an EOF. Default is" - " false" - ), - ) - termination_message_path: Optional[str] = Field( - default=None, - alias="terminationMessagePath", - description=( - "Optional: Path at which the file to which the container's termination" - " message will be written is mounted into the container's filesystem." - " Message written is intended to be brief final status, such as an" - " assertion failure message. Will be truncated by the node if greater than" - " 4096 bytes. The total message length across all containers will be" - " limited to 12kb. Defaults to /dev/termination-log. Cannot be updated." - ), - ) - termination_message_policy: Optional[str] = Field( - default=None, - alias="terminationMessagePolicy", - description=( - "Indicate how the termination message should be populated. File will use" - " the contents of terminationMessagePath to populate the container status" - " message on both success and failure. FallbackToLogsOnError will use the" - " last chunk of container log output if the termination message file is" - " empty and the container exited with an error. The log output is limited" - " to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot" - " be updated." - ), - ) - tty: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a TTY for itself, also requires" - " 'stdin' to be true. Default is false." - ), - ) - volume_devices: Optional[List[v1.VolumeDevice]] = Field( - default=None, - alias="volumeDevices", - description=("volumeDevices is the list of block devices to be used by the container."), - ) - volume_mounts: Optional[List[v1.VolumeMount]] = Field( - default=None, - alias="volumeMounts", - description=("Pod volumes to mount into the container's filesystem. Cannot be updated."), - ) - working_dir: Optional[str] = Field( - default=None, - alias="workingDir", - description=( - "Container's working directory. If not specified, the container runtime's" - " default will be used, which might be configured in the container image." - " Cannot be updated." - ), - ) +class ArtifactGCStatus(BaseModel): + artifact_results_by_node: Annotated[ + Optional[Dict[str, ArtifactResultNodeStatus]], + Field( + alias="artifactResultsByNode", + description="ArtifactResultsByNode maps Node name to result", + ), + ] = None -class UserContainer(BaseModel): - args: Optional[List[str]] = Field( - default=None, - description=( - "Arguments to the entrypoint. The container image's CMD is used if this is" - " not provided. Variable references $(VAR_NAME) are expanded using the" - " container's environment. If a variable cannot be resolved, the reference" - " in the input string will be unchanged. Double $$ are reduced to a single" - ' $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)"' - ' will produce the string literal "$(VAR_NAME)". Escaped references will' - " never be expanded, regardless of whether the variable exists or not." - " Cannot be updated. More info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - command: Optional[List[str]] = Field( - default=None, - description=( - "Entrypoint array. Not executed within a shell. The container image's" - " ENTRYPOINT is used if this is not provided. Variable references" - " $(VAR_NAME) are expanded using the container's environment. If a" - " variable cannot be resolved, the reference in the input string will be" - " unchanged. Double $$ are reduced to a single $, which allows for escaping" - ' the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string' - ' literal "$(VAR_NAME)". Escaped references will never be expanded,' - " regardless of whether the variable exists or not. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - env: Optional[List[v1.EnvVar]] = Field( - default=None, - description=("List of environment variables to set in the container. Cannot be updated."), - ) - env_from: Optional[List[v1.EnvFromSource]] = Field( - default=None, - alias="envFrom", - description=( - "List of sources to populate environment variables in the container. The" - " keys defined within a source must be a C_IDENTIFIER. All invalid keys" - " will be reported as an event when the container is starting. When a key" - " exists in multiple sources, the value associated with the last source" - " will take precedence. Values defined by an Env with a duplicate key will" - " take precedence. Cannot be updated." - ), - ) - image: Optional[str] = Field( - default=None, - description=( - "Container image name. More info:" - " https://kubernetes.io/docs/concepts/containers/images This field is" - " optional to allow higher level config management to default or override" - " container images in workload controllers like Deployments and" - " StatefulSets." - ), - ) - image_pull_policy: Optional[str] = Field( - default=None, - alias="imagePullPolicy", - description=( - "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always" - " if :latest tag is specified, or IfNotPresent otherwise. Cannot be" - " updated. More info:" - " https://kubernetes.io/docs/concepts/containers/images#updating-images" - ), - ) - lifecycle: Optional[v1.Lifecycle] = Field( - default=None, - description=( - "Actions that the management system should take in response to container" - " lifecycle events. Cannot be updated." - ), - ) - liveness_probe: Optional[v1.Probe] = Field( - default=None, - alias="livenessProbe", - description=( - "Periodic probe of container liveness. Container will be restarted if the" - " probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - mirror_volume_mounts: Optional[bool] = Field( - default=None, - alias="mirrorVolumeMounts", - description=( - "MirrorVolumeMounts will mount the same volumes specified in the main" - " container to the container (including artifacts), at the same mountPaths." - " This enables dind daemon to partially see the same filesystem as the main" - " container in order to use features such as docker volume binding" - ), - ) - name: str = Field( - ..., - description=( - "Name of the container specified as a DNS_LABEL. Each container in a pod" - " must have a unique name (DNS_LABEL). Cannot be updated." - ), - ) - ports: Optional[List[v1.ContainerPort]] = Field( - default=None, - description=( - "List of ports to expose from the container. Exposing a port here gives the" - " system additional information about the network connections a container" - " uses, but is primarily informational. Not specifying a port here DOES NOT" - " prevent that port from being exposed. Any port which is listening on the" - ' default "0.0.0.0" address inside a container will be accessible from the' - " network. Cannot be updated." - ), - ) - readiness_probe: Optional[v1.Probe] = Field( - default=None, - alias="readinessProbe", - description=( - "Periodic probe of container service readiness. Container will be removed" - " from service endpoints if the probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - resources: Optional[v1.ResourceRequirements] = Field( - default=None, - description=( - "Compute Resources required by this container. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - security_context: Optional[v1.SecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext defines the security options the container should be run" - " with. If set, the fields of SecurityContext override the equivalent" - " fields of PodSecurityContext. More info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" - ), - ) - startup_probe: Optional[v1.Probe] = Field( - default=None, - alias="startupProbe", - description=( - "StartupProbe indicates that the Pod has successfully initialized. If" - " specified, no other probes are executed until this completes" - " successfully. If this probe fails, the Pod will be restarted, just as if" - " the livenessProbe failed. This can be used to provide different probe" - " parameters at the beginning of a Pod's lifecycle, when it might take a" - " long time to load data or warm a cache, than during steady-state" - " operation. This cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - stdin: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a buffer for stdin in the container" - " runtime. If this is not set, reads from stdin in the container will" - " always result in EOF. Default is false." - ), - ) - stdin_once: Optional[bool] = Field( - default=None, - alias="stdinOnce", - description=( - "Whether the container runtime should close the stdin channel after it has" - " been opened by a single attach. When stdin is true the stdin stream will" - " remain open across multiple attach sessions. If stdinOnce is set to true," - " stdin is opened on container start, is empty until the first client" - " attaches to stdin, and then remains open and accepts data until the" - " client disconnects, at which time stdin is closed and remains closed" - " until the container is restarted. If this flag is false, a container" - " processes that reads from stdin will never receive an EOF. Default is" - " false" - ), - ) - termination_message_path: Optional[str] = Field( - default=None, - alias="terminationMessagePath", - description=( - "Optional: Path at which the file to which the container's termination" - " message will be written is mounted into the container's filesystem." - " Message written is intended to be brief final status, such as an" - " assertion failure message. Will be truncated by the node if greater than" - " 4096 bytes. The total message length across all containers will be" - " limited to 12kb. Defaults to /dev/termination-log. Cannot be updated." - ), - ) - termination_message_policy: Optional[str] = Field( - default=None, - alias="terminationMessagePolicy", - description=( - "Indicate how the termination message should be populated. File will use" - " the contents of terminationMessagePath to populate the container status" - " message on both success and failure. FallbackToLogsOnError will use the" - " last chunk of container log output if the termination message file is" - " empty and the container exited with an error. The log output is limited" - " to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot" - " be updated." - ), - ) - tty: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a TTY for itself, also requires" - " 'stdin' to be true. Default is false." - ), - ) - volume_devices: Optional[List[v1.VolumeDevice]] = Field( - default=None, - alias="volumeDevices", - description=("volumeDevices is the list of block devices to be used by the container."), - ) - volume_mounts: Optional[List[v1.VolumeMount]] = Field( - default=None, - alias="volumeMounts", - description=("Pod volumes to mount into the container's filesystem. Cannot be updated."), - ) - working_dir: Optional[str] = Field( - default=None, - alias="workingDir", - description=( - "Container's working directory. If not specified, the container runtime's" - " default will be used, which might be configured in the container image." - " Cannot be updated." - ), - ) +class InfoResponse(BaseModel): + links: Optional[List[Link]] = None + managed_namespace: Annotated[Optional[str], Field(alias="managedNamespace")] = None + modals: Annotated[Optional[Dict[str, bool]], Field(title="which modals to show")] = None + nav_color: Annotated[Optional[str], Field(alias="navColor")] = None -class Arguments(BaseModel): - artifacts: Optional[List[Artifact]] = Field( - default=None, - description=("Artifacts is the list of artifacts to pass to the template or workflow"), - ) - parameters: Optional[List[Parameter]] = Field( - default=None, - description=("Parameters is the list of parameters to pass to the template or workflow"), - ) +class Inputs(BaseModel): + artifacts: Annotated[ + Optional[List[Artifact]], + Field(description="Artifact are a list of artifacts passed as inputs"), + ] = None + parameters: Annotated[ + Optional[List[Parameter]], + Field(description="Parameters are a list of parameters passed as inputs"), + ] = None -class ArtifactGCSpec(BaseModel): - artifacts_by_node: Optional[Dict[str, ArtifactNodeSpec]] = Field( - default=None, - alias="artifactsByNode", - description=("ArtifactsByNode maps Node name to information pertaining to Artifacts on" " that Node"), - ) +class Metrics(BaseModel): + prometheus: Annotated[ + Optional[List[Prometheus]], + Field(description="Prometheus is a list of prometheus metrics to be emitted"), + ] = None -class Data(BaseModel): - source: DataSource = Field(..., description="Source sources external data into a data template") - transformation: List[TransformationStep] = Field( - ..., description="Transformation applies a set of transformations" - ) +class Outputs(BaseModel): + artifacts: Annotated[ + Optional[List[Artifact]], + Field(description=("Artifacts holds the list of output artifacts produced by a step")), + ] = None + exit_code: Annotated[ + Optional[str], + Field( + alias="exitCode", + description="ExitCode holds the exit code of a script template", + ), + ] = None + parameters: Annotated[ + Optional[List[Parameter]], + Field(description=("Parameters holds the list of output parameters produced by a step")), + ] = None + result: Annotated[ + Optional[str], + Field(description="Result holds the result (stdout) of a script template"), + ] = None class LifecycleHook(BaseModel): - arguments: Optional[Arguments] = Field(default=None, description="Arguments hold arguments to the template") - expression: Optional[str] = Field( - default=None, - description=( - "Expression is a condition expression for when a node will be retried. If" - " it evaluates to false, the node will not be retried and the retry" - " strategy will be ignored" - ), - ) - template: Optional[str] = Field( - default=None, - description="Template is the name of the template to execute by the hook", - ) - template_ref: Optional[TemplateRef] = Field( - default=None, - alias="templateRef", - description=("TemplateRef is the reference to the template resource to execute by the" " hook"), - ) + arguments: Annotated[ + Optional[Arguments], + Field(description="Arguments hold arguments to the template"), + ] = None + expression: Annotated[ + Optional[str], + Field( + description=( + "Expression is a condition expression for when a node will be retried." + " If it evaluates to false, the node will not be retried and the retry" + " strategy will be ignored" + ) + ), + ] = None + template: Annotated[ + Optional[str], + Field(description="Template is the name of the template to execute by the hook"), + ] = None + template_ref: Annotated[ + Optional[TemplateRef], + Field( + alias="templateRef", + description=("TemplateRef is the reference to the template resource to execute by" " the hook"), + ), + ] = None + + +class HTTP(BaseModel): + body: Annotated[Optional[str], Field(description="Body is content of the HTTP Request")] = None + body_from: Annotated[ + Optional[HTTPBodySource], + Field( + alias="bodyFrom", + description="BodyFrom is content of the HTTP Request as Bytes", + ), + ] = None + headers: Annotated[ + Optional[List[HTTPHeader]], + Field(description=("Headers are an optional list of headers to send with HTTP requests")), + ] = None + insecure_skip_verify: Annotated[ + Optional[bool], + Field( + alias="insecureSkipVerify", + description=( + "InsecureSkipVerify is a bool when if set to true will skip TLS" " verification for the HTTP client" + ), + ), + ] = None + method: Annotated[Optional[str], Field(description="Method is HTTP methods for HTTP Request")] = None + success_condition: Annotated[ + Optional[str], + Field( + alias="successCondition", + description=("SuccessCondition is an expression if evaluated to true is considered" " successful"), + ), + ] = None + timeout_seconds: Annotated[ + Optional[int], + Field( + alias="timeoutSeconds", + description=("TimeoutSeconds is request timeout for HTTP Request. Default is 30" " seconds"), + ), + ] = None + url: Annotated[str, Field(description="URL of the HTTP Request")] class NodeResult(BaseModel): @@ -2521,1284 +2314,2407 @@ class NodeResult(BaseModel): class NodeStatus(BaseModel): - boundary_id: Optional[str] = Field( - default=None, - alias="boundaryID", - description=( - "BoundaryID indicates the node ID of the associated template root node in" " which this node belongs to" - ), - ) - children: Optional[List[str]] = Field(default=None, description="Children is a list of child node IDs") - daemoned: Optional[bool] = Field( - default=None, - description=("Daemoned tracks whether or not this node was daemoned and need to be" " terminated"), - ) - display_name: Optional[str] = Field( - default=None, - alias="displayName", - description=( - "DisplayName is a human readable representation of the node. Unique within" " a template boundary" - ), - ) - estimated_duration: Optional[int] = Field( - default=None, - alias="estimatedDuration", - description="EstimatedDuration in seconds.", - ) - finished_at: Optional[v1_1.Time] = Field( - default=None, - alias="finishedAt", - description="Time at which this node completed", - ) - host_node_name: Optional[str] = Field( - default=None, - alias="hostNodeName", - description=("HostNodeName name of the Kubernetes node on which the Pod is running, if" " applicable"), - ) - id: str = Field( - ..., - description=( - "ID is a unique identifier of a node within the worklow It is implemented" - " as a hash of the node name, which makes the ID deterministic" - ), - ) - inputs: Optional[Inputs] = Field( - default=None, - description=( - "Inputs captures input parameter values and artifact locations supplied to" " this template invocation" - ), - ) - memoization_status: Optional[MemoizationStatus] = Field( - default=None, - alias="memoizationStatus", - description="MemoizationStatus holds information about cached nodes", - ) - message: Optional[str] = Field( - default=None, - description=("A human readable message indicating details about why the node is in this" " condition."), - ) - name: str = Field( - ..., - description="Name is unique name in the node tree used to generate the node ID", - ) - outbound_nodes: Optional[List[str]] = Field( - default=None, - alias="outboundNodes", - description=( - 'OutboundNodes tracks the node IDs which are considered "outbound" nodes to' - " a template invocation. For every invocation of a template, there are" - ' nodes which we considered as "outbound". Essentially, these are last' - " nodes in the execution sequence to run, before the template is considered" - " completed. These nodes are then connected as parents to a following" - " step.\n\nIn the case of single pod steps (i.e. container, script," - " resource templates), this list will be nil since the pod itself is" - ' already considered the "outbound" node. In the case of DAGs, outbound' - ' nodes are the "target" tasks (tasks with no children). In the case of' - " steps, outbound nodes are all the containers involved in the last step" - " group. NOTE: since templates are composable, the list of outbound nodes" - " are carried upwards when a DAG/steps template invokes another DAG/steps" - " template. In other words, the outbound nodes of a template, will be a" - " superset of the outbound nodes of its last children." - ), - ) - outputs: Optional[Outputs] = Field( - default=None, - description=( - "Outputs captures output parameter values and artifact locations produced" " by this template invocation" - ), - ) - phase: Optional[str] = Field( - default=None, - description=( - "Phase a simple, high-level summary of where the node is in its lifecycle." - " Can be used as a state machine." - ), - ) - pod_ip: Optional[str] = Field( - default=None, - alias="podIP", - description="PodIP captures the IP of the pod for daemoned steps", - ) - progress: Optional[str] = Field(default=None, description="Progress to completion") - resources_duration: Optional[Dict[str, int]] = Field( - default=None, - alias="resourcesDuration", - description=( - "ResourcesDuration is indicative, but not accurate, resource duration. This" - " is populated when the nodes completes." - ), - ) - started_at: Optional[v1_1.Time] = Field( - default=None, alias="startedAt", description="Time at which this node started" - ) - synchronization_status: Optional[NodeSynchronizationStatus] = Field( - default=None, - alias="synchronizationStatus", - description="SynchronizationStatus is the synchronization status of the node", - ) - template_name: Optional[str] = Field( - default=None, - alias="templateName", - description=( - "TemplateName is the template name which this node corresponds to. Not" - " applicable to virtual nodes (e.g. Retry, StepGroup)" - ), - ) - template_ref: Optional[TemplateRef] = Field( - default=None, - alias="templateRef", - description=( - "TemplateRef is the reference to the template resource which this node" - " corresponds to. Not applicable to virtual nodes (e.g. Retry, StepGroup)" - ), - ) - template_scope: Optional[str] = Field( - default=None, - alias="templateScope", - description=("TemplateScope is the template scope in which the template of this node was" " retrieved."), - ) - type: str = Field(..., description="Type indicates type of node") + boundary_id: Annotated[ + Optional[str], + Field( + alias="boundaryID", + description=( + "BoundaryID indicates the node ID of the associated template root node" + " in which this node belongs to" + ), + ), + ] = None + children: Annotated[Optional[List[str]], Field(description="Children is a list of child node IDs")] = None + daemoned: Annotated[ + Optional[bool], + Field(description=("Daemoned tracks whether or not this node was daemoned and need to be" " terminated")), + ] = None + display_name: Annotated[ + Optional[str], + Field( + alias="displayName", + description=( + "DisplayName is a human readable representation of the node. Unique" " within a template boundary" + ), + ), + ] = None + estimated_duration: Annotated[ + Optional[int], + Field(alias="estimatedDuration", description="EstimatedDuration in seconds."), + ] = None + finished_at: Annotated[ + Optional[v1_1.Time], + Field(alias="finishedAt", description="Time at which this node completed"), + ] = None + host_node_name: Annotated[ + Optional[str], + Field( + alias="hostNodeName", + description=("HostNodeName name of the Kubernetes node on which the Pod is running," " if applicable"), + ), + ] = None + id: Annotated[ + str, + Field( + description=( + "ID is a unique identifier of a node within the worklow It is" + " implemented as a hash of the node name, which makes the ID" + " deterministic" + ) + ), + ] + inputs: Annotated[ + Optional[Inputs], + Field( + description=( + "Inputs captures input parameter values and artifact locations supplied" " to this template invocation" + ) + ), + ] = None + memoization_status: Annotated[ + Optional[MemoizationStatus], + Field( + alias="memoizationStatus", + description="MemoizationStatus holds information about cached nodes", + ), + ] = None + message: Annotated[ + Optional[str], + Field(description=("A human readable message indicating details about why the node is in" " this condition.")), + ] = None + name: Annotated[ + str, + Field(description=("Name is unique name in the node tree used to generate the node ID")), + ] + outbound_nodes: Annotated[ + Optional[List[str]], + Field( + alias="outboundNodes", + description=( + 'OutboundNodes tracks the node IDs which are considered "outbound"' + " nodes to a template invocation. For every invocation of a template," + ' there are nodes which we considered as "outbound". Essentially, these' + " are last nodes in the execution sequence to run, before the template" + " is considered completed. These nodes are then connected as parents to" + " a following step.\n\nIn the case of single pod steps (i.e. container," + " script, resource templates), this list will be nil since the pod" + ' itself is already considered the "outbound" node. In the case of' + ' DAGs, outbound nodes are the "target" tasks (tasks with no children).' + " In the case of steps, outbound nodes are all the containers involved" + " in the last step group. NOTE: since templates are composable, the" + " list of outbound nodes are carried upwards when a DAG/steps template" + " invokes another DAG/steps template. In other words, the outbound" + " nodes of a template, will be a superset of the outbound nodes of its" + " last children." + ), + ), + ] = None + outputs: Annotated[ + Optional[Outputs], + Field( + description=( + "Outputs captures output parameter values and artifact locations" + " produced by this template invocation" + ) + ), + ] = None + phase: Annotated[ + Optional[str], + Field( + description=( + "Phase a simple, high-level summary of where the node is in its" + " lifecycle. Can be used as a state machine." + ) + ), + ] = None + pod_ip: Annotated[ + Optional[str], + Field( + alias="podIP", + description="PodIP captures the IP of the pod for daemoned steps", + ), + ] = None + progress: Annotated[Optional[str], Field(description="Progress to completion")] = None + resources_duration: Annotated[ + Optional[Dict[str, int]], + Field( + alias="resourcesDuration", + description=( + "ResourcesDuration is indicative, but not accurate, resource duration." + " This is populated when the nodes completes." + ), + ), + ] = None + started_at: Annotated[ + Optional[v1_1.Time], + Field(alias="startedAt", description="Time at which this node started"), + ] = None + synchronization_status: Annotated[ + Optional[NodeSynchronizationStatus], + Field( + alias="synchronizationStatus", + description=("SynchronizationStatus is the synchronization status of the node"), + ), + ] = None + template_name: Annotated[ + Optional[str], + Field( + alias="templateName", + description=( + "TemplateName is the template name which this node corresponds to. Not" + " applicable to virtual nodes (e.g. Retry, StepGroup)" + ), + ), + ] = None + template_ref: Annotated[ + Optional[TemplateRef], + Field( + alias="templateRef", + description=( + "TemplateRef is the reference to the template resource which this node" + " corresponds to. Not applicable to virtual nodes (e.g. Retry," + " StepGroup)" + ), + ), + ] = None + template_scope: Annotated[ + Optional[str], + Field( + alias="templateScope", + description=("TemplateScope is the template scope in which the template of this node" " was retrieved."), + ), + ] = None + type: Annotated[str, Field(description="Type indicates type of node")] -class Submit(BaseModel): - arguments: Optional[Arguments] = Field( - default=None, - description=("Arguments extracted from the event and then set as arguments to the" " workflow created."), - ) - metadata: Optional[v1_1.ObjectMeta] = Field( - default=None, - description=("Metadata optional means to customize select fields of the workflow" " metadata"), - ) - workflow_template_ref: WorkflowTemplateRef = Field( - ..., - alias="workflowTemplateRef", - description="WorkflowTemplateRef the workflow template to submit", - ) +class PodGC(BaseModel): + label_selector: Annotated[ + Optional[v1_1.LabelSelector], + Field( + alias="labelSelector", + description=( + "LabelSelector is the label selector to check if the pods match the" + " labels before being added to the pod GC queue." + ), + ), + ] = None + strategy: Annotated[ + Optional[str], + Field( + description=( + 'Strategy is the strategy to use. One of "OnPodCompletion",' + ' "OnPodSuccess", "OnWorkflowCompletion", "OnWorkflowSuccess"' + ) + ), + ] = None -class WorkflowEventBindingSpec(BaseModel): - event: Event = Field(..., description="Event is the event to bind to") - submit: Optional[Submit] = Field(default=None, description="Submit is the workflow template to submit") +class Submit(BaseModel): + arguments: Annotated[ + Optional[Arguments], + Field( + description=("Arguments extracted from the event and then set as arguments to the" " workflow created.") + ), + ] = None + metadata: Annotated[ + Optional[v1_1.ObjectMeta], + Field(description=("Metadata optional means to customize select fields of the workflow" " metadata")), + ] = None + workflow_template_ref: Annotated[ + WorkflowTemplateRef, + Field( + alias="workflowTemplateRef", + description="WorkflowTemplateRef the workflow template to submit", + ), + ] -class WorkflowTaskSetStatus(BaseModel): - nodes: Optional[Dict[str, NodeResult]] = None +class WorkflowEventBindingSpec(BaseModel): + event: Annotated[Event, Field(description="Event is the event to bind to")] + submit: Annotated[Optional[Submit], Field(description="Submit is the workflow template to submit")] = None class WorkflowEventBinding(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ObjectMeta spec: WorkflowEventBindingSpec -class WorkflowEventBindingList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[WorkflowEventBinding]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ListMeta +class ContainerNode(BaseModel): + args: Annotated[ + Optional[List[str]], + Field( + description=( + "Arguments to the entrypoint. The container image's CMD is used if" + " this is not provided. Variable references $(VAR_NAME) are expanded" + " using the container's environment. If a variable cannot be resolved," + " the reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + " of whether the variable exists or not. Cannot be updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Entrypoint array. Not executed within a shell. The container image's" + " ENTRYPOINT is used if this is not provided. Variable references" + " $(VAR_NAME) are expanded using the container's environment. If a" + " variable cannot be resolved, the reference in the input string will" + " be unchanged. Double $$ are reduced to a single $, which allows for" + ' escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the' + ' string literal "$(VAR_NAME)". Escaped references will never be' + " expanded, regardless of whether the variable exists or not. Cannot be" + " updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + dependencies: Optional[List[str]] = None + env: Annotated[ + Optional[List[v1.EnvVar]], + Field(description=("List of environment variables to set in the container. Cannot be" " updated.")), + ] = None + env_from: Annotated[ + Optional[List[v1.EnvFromSource]], + Field( + alias="envFrom", + description=( + "List of sources to populate environment variables in the container." + " The keys defined within a source must be a C_IDENTIFIER. All invalid" + " keys will be reported as an event when the container is starting." + " When a key exists in multiple sources, the value associated with the" + " last source will take precedence. Values defined by an Env with a" + " duplicate key will take precedence. Cannot be updated." + ), + ), + ] = None + image: Annotated[ + Optional[str], + Field( + description=( + "Container image name. More info:" + " https://kubernetes.io/docs/concepts/containers/images This field is" + " optional to allow higher level config management to default or" + " override container images in workload controllers like Deployments" + " and StatefulSets." + ) + ), + ] = None + image_pull_policy: Annotated[ + Optional[str], + Field( + alias="imagePullPolicy", + description=( + "Image pull policy. One of Always, Never, IfNotPresent. Defaults to" + " Always if :latest tag is specified, or IfNotPresent otherwise. Cannot" + " be updated. More info:" + " https://kubernetes.io/docs/concepts/containers/images#updating-images" + ), + ), + ] = None + lifecycle: Annotated[ + Optional[v1.Lifecycle], + Field( + description=( + "Actions that the management system should take in response to" + " container lifecycle events. Cannot be updated." + ) + ), + ] = None + liveness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="livenessProbe", + description=( + "Periodic probe of container liveness. Container will be restarted if" + " the probe fails. Cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + name: Annotated[ + str, + Field( + description=( + "Name of the container specified as a DNS_LABEL. Each container in a" + " pod must have a unique name (DNS_LABEL). Cannot be updated." + ) + ), + ] + ports: Annotated[ + Optional[List[v1.ContainerPort]], + Field( + description=( + "List of ports to expose from the container. Exposing a port here gives" + " the system additional information about the network connections a" + " container uses, but is primarily informational. Not specifying a port" + " here DOES NOT prevent that port from being exposed. Any port which is" + ' listening on the default "0.0.0.0" address inside a container will be' + " accessible from the network. Cannot be updated." + ) + ), + ] = None + readiness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="readinessProbe", + description=( + "Periodic probe of container service readiness. Container will be" + " removed from service endpoints if the probe fails. Cannot be updated." + " More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + resources: Annotated[ + Optional[v1.ResourceRequirements], + Field( + description=( + "Compute Resources required by this container. Cannot be updated. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + security_context: Annotated[ + Optional[v1.SecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext defines the security options the container should be" + " run with. If set, the fields of SecurityContext override the" + " equivalent fields of PodSecurityContext. More info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" + ), + ), + ] = None + startup_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="startupProbe", + description=( + "StartupProbe indicates that the Pod has successfully initialized. If" + " specified, no other probes are executed until this completes" + " successfully. If this probe fails, the Pod will be restarted, just as" + " if the livenessProbe failed. This can be used to provide different" + " probe parameters at the beginning of a Pod's lifecycle, when it might" + " take a long time to load data or warm a cache, than during" + " steady-state operation. This cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + stdin: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a buffer for stdin in the" + " container runtime. If this is not set, reads from stdin in the" + " container will always result in EOF. Default is false." + ) + ), + ] = None + stdin_once: Annotated[ + Optional[bool], + Field( + alias="stdinOnce", + description=( + "Whether the container runtime should close the stdin channel after it" + " has been opened by a single attach. When stdin is true the stdin" + " stream will remain open across multiple attach sessions. If stdinOnce" + " is set to true, stdin is opened on container start, is empty until" + " the first client attaches to stdin, and then remains open and accepts" + " data until the client disconnects, at which time stdin is closed and" + " remains closed until the container is restarted. If this flag is" + " false, a container processes that reads from stdin will never receive" + " an EOF. Default is false" + ), + ), + ] = None + termination_message_path: Annotated[ + Optional[str], + Field( + alias="terminationMessagePath", + description=( + "Optional: Path at which the file to which the container's termination" + " message will be written is mounted into the container's filesystem." + " Message written is intended to be brief final status, such as an" + " assertion failure message. Will be truncated by the node if greater" + " than 4096 bytes. The total message length across all containers will" + " be limited to 12kb. Defaults to /dev/termination-log. Cannot be" + " updated." + ), + ), + ] = None + termination_message_policy: Annotated[ + Optional[str], + Field( + alias="terminationMessagePolicy", + description=( + "Indicate how the termination message should be populated. File will" + " use the contents of terminationMessagePath to populate the container" + " status message on both success and failure. FallbackToLogsOnError" + " will use the last chunk of container log output if the termination" + " message file is empty and the container exited with an error. The log" + " output is limited to 2048 bytes or 80 lines, whichever is smaller." + " Defaults to File. Cannot be updated." + ), + ), + ] = None + tty: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a TTY for itself, also requires" + " 'stdin' to be true. Default is false." + ) + ), + ] = None + volume_devices: Annotated[ + Optional[List[v1.VolumeDevice]], + Field( + alias="volumeDevices", + description=("volumeDevices is the list of block devices to be used by the" " container."), + ), + ] = None + volume_mounts: Annotated[ + Optional[List[v1.VolumeMount]], + Field( + alias="volumeMounts", + description=("Pod volumes to mount into the container's filesystem. Cannot be" " updated."), + ), + ] = None + working_dir: Annotated[ + Optional[str], + Field( + alias="workingDir", + description=( + "Container's working directory. If not specified, the container" + " runtime's default will be used, which might be configured in the" + " container image. Cannot be updated." + ), + ), + ] = None -class ClusterWorkflowTemplate(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ObjectMeta - spec: WorkflowSpec +class ScriptTemplate(BaseModel): + args: Annotated[ + Optional[List[str]], + Field( + description=( + "Arguments to the entrypoint. The container image's CMD is used if" + " this is not provided. Variable references $(VAR_NAME) are expanded" + " using the container's environment. If a variable cannot be resolved," + " the reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + " of whether the variable exists or not. Cannot be updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Entrypoint array. Not executed within a shell. The container image's" + " ENTRYPOINT is used if this is not provided. Variable references" + " $(VAR_NAME) are expanded using the container's environment. If a" + " variable cannot be resolved, the reference in the input string will" + " be unchanged. Double $$ are reduced to a single $, which allows for" + ' escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the' + ' string literal "$(VAR_NAME)". Escaped references will never be' + " expanded, regardless of whether the variable exists or not. Cannot be" + " updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + env: Annotated[ + Optional[List[v1.EnvVar]], + Field(description=("List of environment variables to set in the container. Cannot be" " updated.")), + ] = None + env_from: Annotated[ + Optional[List[v1.EnvFromSource]], + Field( + alias="envFrom", + description=( + "List of sources to populate environment variables in the container." + " The keys defined within a source must be a C_IDENTIFIER. All invalid" + " keys will be reported as an event when the container is starting." + " When a key exists in multiple sources, the value associated with the" + " last source will take precedence. Values defined by an Env with a" + " duplicate key will take precedence. Cannot be updated." + ), + ), + ] = None + image: Annotated[ + str, + Field( + description=( + "Container image name. More info:" + " https://kubernetes.io/docs/concepts/containers/images This field is" + " optional to allow higher level config management to default or" + " override container images in workload controllers like Deployments" + " and StatefulSets." + ) + ), + ] + image_pull_policy: Annotated[ + Optional[str], + Field( + alias="imagePullPolicy", + description=( + "Image pull policy. One of Always, Never, IfNotPresent. Defaults to" + " Always if :latest tag is specified, or IfNotPresent otherwise. Cannot" + " be updated. More info:" + " https://kubernetes.io/docs/concepts/containers/images#updating-images" + ), + ), + ] = None + lifecycle: Annotated[ + Optional[v1.Lifecycle], + Field( + description=( + "Actions that the management system should take in response to" + " container lifecycle events. Cannot be updated." + ) + ), + ] = None + liveness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="livenessProbe", + description=( + "Periodic probe of container liveness. Container will be restarted if" + " the probe fails. Cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the container specified as a DNS_LABEL. Each container in a" + " pod must have a unique name (DNS_LABEL). Cannot be updated." + ) + ), + ] = None + ports: Annotated[ + Optional[List[v1.ContainerPort]], + Field( + description=( + "List of ports to expose from the container. Exposing a port here gives" + " the system additional information about the network connections a" + " container uses, but is primarily informational. Not specifying a port" + " here DOES NOT prevent that port from being exposed. Any port which is" + ' listening on the default "0.0.0.0" address inside a container will be' + " accessible from the network. Cannot be updated." + ) + ), + ] = None + readiness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="readinessProbe", + description=( + "Periodic probe of container service readiness. Container will be" + " removed from service endpoints if the probe fails. Cannot be updated." + " More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + resources: Annotated[ + Optional[v1.ResourceRequirements], + Field( + description=( + "Compute Resources required by this container. Cannot be updated. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + security_context: Annotated[ + Optional[v1.SecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext defines the security options the container should be" + " run with. If set, the fields of SecurityContext override the" + " equivalent fields of PodSecurityContext. More info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" + ), + ), + ] = None + source: Annotated[ + str, + Field(description="Source contains the source code of the script to execute"), + ] + startup_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="startupProbe", + description=( + "StartupProbe indicates that the Pod has successfully initialized. If" + " specified, no other probes are executed until this completes" + " successfully. If this probe fails, the Pod will be restarted, just as" + " if the livenessProbe failed. This can be used to provide different" + " probe parameters at the beginning of a Pod's lifecycle, when it might" + " take a long time to load data or warm a cache, than during" + " steady-state operation. This cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + stdin: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a buffer for stdin in the" + " container runtime. If this is not set, reads from stdin in the" + " container will always result in EOF. Default is false." + ) + ), + ] = None + stdin_once: Annotated[ + Optional[bool], + Field( + alias="stdinOnce", + description=( + "Whether the container runtime should close the stdin channel after it" + " has been opened by a single attach. When stdin is true the stdin" + " stream will remain open across multiple attach sessions. If stdinOnce" + " is set to true, stdin is opened on container start, is empty until" + " the first client attaches to stdin, and then remains open and accepts" + " data until the client disconnects, at which time stdin is closed and" + " remains closed until the container is restarted. If this flag is" + " false, a container processes that reads from stdin will never receive" + " an EOF. Default is false" + ), + ), + ] = None + termination_message_path: Annotated[ + Optional[str], + Field( + alias="terminationMessagePath", + description=( + "Optional: Path at which the file to which the container's termination" + " message will be written is mounted into the container's filesystem." + " Message written is intended to be brief final status, such as an" + " assertion failure message. Will be truncated by the node if greater" + " than 4096 bytes. The total message length across all containers will" + " be limited to 12kb. Defaults to /dev/termination-log. Cannot be" + " updated." + ), + ), + ] = None + termination_message_policy: Annotated[ + Optional[str], + Field( + alias="terminationMessagePolicy", + description=( + "Indicate how the termination message should be populated. File will" + " use the contents of terminationMessagePath to populate the container" + " status message on both success and failure. FallbackToLogsOnError" + " will use the last chunk of container log output if the termination" + " message file is empty and the container exited with an error. The log" + " output is limited to 2048 bytes or 80 lines, whichever is smaller." + " Defaults to File. Cannot be updated." + ), + ), + ] = None + tty: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a TTY for itself, also requires" + " 'stdin' to be true. Default is false." + ) + ), + ] = None + volume_devices: Annotated[ + Optional[List[v1.VolumeDevice]], + Field( + alias="volumeDevices", + description=("volumeDevices is the list of block devices to be used by the" " container."), + ), + ] = None + volume_mounts: Annotated[ + Optional[List[v1.VolumeMount]], + Field( + alias="volumeMounts", + description=("Pod volumes to mount into the container's filesystem. Cannot be" " updated."), + ), + ] = None + working_dir: Annotated[ + Optional[str], + Field( + alias="workingDir", + description=( + "Container's working directory. If not specified, the container" + " runtime's default will be used, which might be configured in the" + " container image. Cannot be updated." + ), + ), + ] = None -class ClusterWorkflowTemplateCreateRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") - template: Optional[ClusterWorkflowTemplate] = None +class UserContainer(BaseModel): + args: Annotated[ + Optional[List[str]], + Field( + description=( + "Arguments to the entrypoint. The container image's CMD is used if" + " this is not provided. Variable references $(VAR_NAME) are expanded" + " using the container's environment. If a variable cannot be resolved," + " the reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + " of whether the variable exists or not. Cannot be updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Entrypoint array. Not executed within a shell. The container image's" + " ENTRYPOINT is used if this is not provided. Variable references" + " $(VAR_NAME) are expanded using the container's environment. If a" + " variable cannot be resolved, the reference in the input string will" + " be unchanged. Double $$ are reduced to a single $, which allows for" + ' escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the' + ' string literal "$(VAR_NAME)". Escaped references will never be' + " expanded, regardless of whether the variable exists or not. Cannot be" + " updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + env: Annotated[ + Optional[List[v1.EnvVar]], + Field(description=("List of environment variables to set in the container. Cannot be" " updated.")), + ] = None + env_from: Annotated[ + Optional[List[v1.EnvFromSource]], + Field( + alias="envFrom", + description=( + "List of sources to populate environment variables in the container." + " The keys defined within a source must be a C_IDENTIFIER. All invalid" + " keys will be reported as an event when the container is starting." + " When a key exists in multiple sources, the value associated with the" + " last source will take precedence. Values defined by an Env with a" + " duplicate key will take precedence. Cannot be updated." + ), + ), + ] = None + image: Annotated[ + Optional[str], + Field( + description=( + "Container image name. More info:" + " https://kubernetes.io/docs/concepts/containers/images This field is" + " optional to allow higher level config management to default or" + " override container images in workload controllers like Deployments" + " and StatefulSets." + ) + ), + ] = None + image_pull_policy: Annotated[ + Optional[str], + Field( + alias="imagePullPolicy", + description=( + "Image pull policy. One of Always, Never, IfNotPresent. Defaults to" + " Always if :latest tag is specified, or IfNotPresent otherwise. Cannot" + " be updated. More info:" + " https://kubernetes.io/docs/concepts/containers/images#updating-images" + ), + ), + ] = None + lifecycle: Annotated[ + Optional[v1.Lifecycle], + Field( + description=( + "Actions that the management system should take in response to" + " container lifecycle events. Cannot be updated." + ) + ), + ] = None + liveness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="livenessProbe", + description=( + "Periodic probe of container liveness. Container will be restarted if" + " the probe fails. Cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + mirror_volume_mounts: Annotated[ + Optional[bool], + Field( + alias="mirrorVolumeMounts", + description=( + "MirrorVolumeMounts will mount the same volumes specified in the main" + " container to the container (including artifacts), at the same" + " mountPaths. This enables dind daemon to partially see the same" + " filesystem as the main container in order to use features such as" + " docker volume binding" + ), + ), + ] = None + name: Annotated[ + str, + Field( + description=( + "Name of the container specified as a DNS_LABEL. Each container in a" + " pod must have a unique name (DNS_LABEL). Cannot be updated." + ) + ), + ] + ports: Annotated[ + Optional[List[v1.ContainerPort]], + Field( + description=( + "List of ports to expose from the container. Exposing a port here gives" + " the system additional information about the network connections a" + " container uses, but is primarily informational. Not specifying a port" + " here DOES NOT prevent that port from being exposed. Any port which is" + ' listening on the default "0.0.0.0" address inside a container will be' + " accessible from the network. Cannot be updated." + ) + ), + ] = None + readiness_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="readinessProbe", + description=( + "Periodic probe of container service readiness. Container will be" + " removed from service endpoints if the probe fails. Cannot be updated." + " More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + resources: Annotated[ + Optional[v1.ResourceRequirements], + Field( + description=( + "Compute Resources required by this container. Cannot be updated. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + security_context: Annotated[ + Optional[v1.SecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext defines the security options the container should be" + " run with. If set, the fields of SecurityContext override the" + " equivalent fields of PodSecurityContext. More info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" + ), + ), + ] = None + startup_probe: Annotated[ + Optional[v1.Probe], + Field( + alias="startupProbe", + description=( + "StartupProbe indicates that the Pod has successfully initialized. If" + " specified, no other probes are executed until this completes" + " successfully. If this probe fails, the Pod will be restarted, just as" + " if the livenessProbe failed. This can be used to provide different" + " probe parameters at the beginning of a Pod's lifecycle, when it might" + " take a long time to load data or warm a cache, than during" + " steady-state operation. This cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + stdin: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a buffer for stdin in the" + " container runtime. If this is not set, reads from stdin in the" + " container will always result in EOF. Default is false." + ) + ), + ] = None + stdin_once: Annotated[ + Optional[bool], + Field( + alias="stdinOnce", + description=( + "Whether the container runtime should close the stdin channel after it" + " has been opened by a single attach. When stdin is true the stdin" + " stream will remain open across multiple attach sessions. If stdinOnce" + " is set to true, stdin is opened on container start, is empty until" + " the first client attaches to stdin, and then remains open and accepts" + " data until the client disconnects, at which time stdin is closed and" + " remains closed until the container is restarted. If this flag is" + " false, a container processes that reads from stdin will never receive" + " an EOF. Default is false" + ), + ), + ] = None + termination_message_path: Annotated[ + Optional[str], + Field( + alias="terminationMessagePath", + description=( + "Optional: Path at which the file to which the container's termination" + " message will be written is mounted into the container's filesystem." + " Message written is intended to be brief final status, such as an" + " assertion failure message. Will be truncated by the node if greater" + " than 4096 bytes. The total message length across all containers will" + " be limited to 12kb. Defaults to /dev/termination-log. Cannot be" + " updated." + ), + ), + ] = None + termination_message_policy: Annotated[ + Optional[str], + Field( + alias="terminationMessagePolicy", + description=( + "Indicate how the termination message should be populated. File will" + " use the contents of terminationMessagePath to populate the container" + " status message on both success and failure. FallbackToLogsOnError" + " will use the last chunk of container log output if the termination" + " message file is empty and the container exited with an error. The log" + " output is limited to 2048 bytes or 80 lines, whichever is smaller." + " Defaults to File. Cannot be updated." + ), + ), + ] = None + tty: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a TTY for itself, also requires" + " 'stdin' to be true. Default is false." + ) + ), + ] = None + volume_devices: Annotated[ + Optional[List[v1.VolumeDevice]], + Field( + alias="volumeDevices", + description=("volumeDevices is the list of block devices to be used by the" " container."), + ), + ] = None + volume_mounts: Annotated[ + Optional[List[v1.VolumeMount]], + Field( + alias="volumeMounts", + description=("Pod volumes to mount into the container's filesystem. Cannot be" " updated."), + ), + ] = None + working_dir: Annotated[ + Optional[str], + Field( + alias="workingDir", + description=( + "Container's working directory. If not specified, the container" + " runtime's default will be used, which might be configured in the" + " container image. Cannot be updated." + ), + ), + ] = None -class ClusterWorkflowTemplateLintRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") - template: Optional[ClusterWorkflowTemplate] = None +class WorkflowTaskSetStatus(BaseModel): + nodes: Optional[Dict[str, NodeResult]] = None -class ClusterWorkflowTemplateList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[ClusterWorkflowTemplate]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) +class WorkflowEventBindingList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[WorkflowEventBinding]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ListMeta -class ClusterWorkflowTemplateUpdateRequest(BaseModel): - name: Optional[str] = Field(default=None, description="DEPRECATED: This field is ignored.") - template: Optional[ClusterWorkflowTemplate] = None +class ContainerSetTemplate(BaseModel): + containers: List[ContainerNode] + retry_strategy: Annotated[ + Optional[ContainerSetRetryStrategy], + Field( + alias="retryStrategy", + description=( + "RetryStrategy describes how to retry a container nodes in the" + " container set if it fails. Nbr of retries(default 0) and sleep" + " duration between retries(default 0s, instant retry) can be set." + ), + ), + ] = None + volume_mounts: Annotated[Optional[List[v1.VolumeMount]], Field(alias="volumeMounts")] = None -class CreateCronWorkflowRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") - cron_workflow: Optional[CronWorkflow] = Field(default=None, alias="cronWorkflow") - namespace: Optional[str] = None +class DAGTemplate(BaseModel): + fail_fast: Annotated[ + Optional[bool], + Field( + alias="failFast", + description=( + 'This flag is for DAG logic. The DAG logic has a built-in "fail fast"' + " feature to stop scheduling new steps, as soon as it detects that one" + " of the DAG nodes is failed. Then it waits until all DAG nodes are" + " completed before failing the DAG itself. The FailFast flag default is" + " true, if set to false, it will allow a DAG to run all branches of" + " the DAG to completion (either success or failure), regardless of the" + " failed outcomes of branches in the DAG. More info and example about" + " this feature at" + " https://github.com/argoproj/argo-workflows/issues/1442" + ), + ), + ] = None + target: Annotated[ + Optional[str], + Field(description="Target are one or more names of targets to execute in a DAG"), + ] = None + tasks: Annotated[List[DAGTask], Field(description="Tasks are a list of DAG tasks")] -class CronWorkflow(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ObjectMeta - spec: CronWorkflowSpec - status: Optional[CronWorkflowStatus] = None +class ParallelSteps(BaseModel): + __root__: List[WorkflowStep] -class CronWorkflowList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[CronWorkflow]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) +class WorkflowTaskSetSpec(BaseModel): + tasks: Optional[Dict[str, Template]] = None + + +class ClusterWorkflowTemplateList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[ClusterWorkflowTemplate]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ListMeta -class CronWorkflowSpec(BaseModel): - concurrency_policy: Optional[str] = Field( - default=None, - alias="concurrencyPolicy", - description=("ConcurrencyPolicy is the K8s-style concurrency policy that will be used"), - ) - failed_jobs_history_limit: Optional[int] = Field( - default=None, - alias="failedJobsHistoryLimit", - description=("FailedJobsHistoryLimit is the number of failed jobs to be kept at a time"), - ) - schedule: str = Field(..., description="Schedule is a schedule to run the Workflow in Cron format") - starting_deadline_seconds: Optional[int] = Field( - default=None, - alias="startingDeadlineSeconds", - description=( - "StartingDeadlineSeconds is the K8s-style deadline that will limit the time" - " a CronWorkflow will be run after its original scheduled time if it is" - " missed." - ), - ) - successful_jobs_history_limit: Optional[int] = Field( - default=None, - alias="successfulJobsHistoryLimit", - description=("SuccessfulJobsHistoryLimit is the number of successful jobs to be kept at" " a time"), - ) - suspend: Optional[bool] = Field( - default=None, - description=("Suspend is a flag that will stop new CronWorkflows from running if set to" " true"), - ) - timezone: Optional[str] = Field( - default=None, - description=( - "Timezone is the timezone against which the cron schedule will be" - ' calculated, e.g. "Asia/Tokyo". Default is machine\'s local time.' - ), - ) - workflow_metadata: Optional[v1_1.ObjectMeta] = Field( - default=None, - alias="workflowMetadata", - description="WorkflowMetadata contains some metadata of the workflow to be run", - ) - workflow_spec: WorkflowSpec = Field( - ..., - alias="workflowSpec", - description="WorkflowSpec is the spec of the workflow to be run", - ) +class CronWorkflowList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[CronWorkflow]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ListMeta -class DAGTask(BaseModel): - arguments: Optional[Arguments] = Field( - default=None, - description=("Arguments are the parameter and artifact arguments to the template"), - ) - continue_on: Optional[ContinueOn] = Field( - default=None, - alias="continueOn", - description=( - "ContinueOn makes argo to proceed with the following step even if this step" - " fails. Errors and Failed states can be specified" - ), - ) - dependencies: Optional[List[str]] = Field( - default=None, - description="Dependencies are name of other targets which this depends on", - ) - depends: Optional[str] = Field( - default=None, - description="Depends are name of other targets which this depends on", - ) - hooks: Optional[Dict[str, LifecycleHook]] = Field( - default=None, - description=( - "Hooks hold the lifecycle hook which is invoked at lifecycle of task," - " irrespective of the success, failure, or error status of the primary task" - ), - ) - inline: Optional[Template] = Field( - default=None, - description=("Inline is the template. Template must be empty if this is declared (and" " vice-versa)."), - ) - name: str = Field(..., description="Name is the name of the target") - on_exit: Optional[str] = Field( - default=None, - alias="onExit", - description=( - "OnExit is a template reference which is invoked at the end of the" - " template, irrespective of the success, failure, or error of the primary" - " template. DEPRECATED: Use Hooks[exit].Template instead." - ), - ) - template: Optional[str] = Field(default=None, description="Name of template to execute") - template_ref: Optional[TemplateRef] = Field( - default=None, - alias="templateRef", - description="TemplateRef is the reference to the template resource to execute.", - ) - when: Optional[str] = Field( - default=None, - description=("When is an expression in which the task should conditionally execute"), - ) - with_items: Optional[List[Item]] = Field( - default=None, - alias="withItems", - description=("WithItems expands a task into multiple parallel tasks from the items in" " the list"), - ) - with_param: Optional[str] = Field( - default=None, - alias="withParam", - description=( - "WithParam expands a task into multiple parallel tasks from the value in" - " the parameter, which is expected to be a JSON list." - ), - ) - with_sequence: Optional[Sequence] = Field( - default=None, - alias="withSequence", - description="WithSequence expands a task into a numeric sequence", - ) +class WorkflowList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[Workflow]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ListMeta -class DAGTemplate(BaseModel): - fail_fast: Optional[bool] = Field( - default=None, - alias="failFast", - description=( - 'This flag is for DAG logic. The DAG logic has a built-in "fail fast"' - " feature to stop scheduling new steps, as soon as it detects that one of" - " the DAG nodes is failed. Then it waits until all DAG nodes are completed" - " before failing the DAG itself. The FailFast flag default is true, if set" - " to false, it will allow a DAG to run all branches of the DAG to" - " completion (either success or failure), regardless of the failed outcomes" - " of branches in the DAG. More info and example about this feature at" - " https://github.com/argoproj/argo-workflows/issues/1442" - ), - ) - target: Optional[str] = Field( - default=None, - description="Target are one or more names of targets to execute in a DAG", - ) - tasks: List[DAGTask] = Field(..., description="Tasks are a list of DAG tasks") +class WorkflowTemplateList(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + items: Optional[List[WorkflowTemplate]] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ListMeta -class LintCronWorkflowRequest(BaseModel): - cron_workflow: Optional[CronWorkflow] = Field(default=None, alias="cronWorkflow") - namespace: Optional[str] = None +class Template(BaseModel): + active_deadline_seconds: Annotated[ + Optional[intstr.IntOrString], + Field( + alias="activeDeadlineSeconds", + description=( + "Optional duration in seconds relative to the StartTime that the pod" + " may be active on a node before the system actively tries to terminate" + " the pod; value must be positive integer This field is only applicable" + " to container and script templates." + ), + ), + ] = None + affinity: Annotated[ + Optional[v1.Affinity], + Field( + description=( + "Affinity sets the pod's scheduling constraints Overrides the affinity" + " set at the workflow level (if any)" + ) + ), + ] = None + archive_location: Annotated[ + Optional[ArtifactLocation], + Field( + alias="archiveLocation", + description=( + "Location in which all files related to the step will be stored (logs," + " artifacts, etc...). Can be overridden by individual items in Outputs." + " If omitted, will use the default artifact repository location" + " configured in the controller, appended with the" + " / in the key." + ), + ), + ] = None + automount_service_account_token: Annotated[ + Optional[bool], + Field( + alias="automountServiceAccountToken", + description=( + "AutomountServiceAccountToken indicates whether a service account token" + " should be automatically mounted in pods. ServiceAccountName of" + " ExecutorConfig must be specified if this value is false." + ), + ), + ] = None + container: Annotated[ + Optional[v1.Container], + Field(description="Container is the main container image to run in the pod"), + ] = None + container_set: Annotated[ + Optional[ContainerSetTemplate], + Field( + alias="containerSet", + description="ContainerSet groups multiple containers within a single pod.", + ), + ] = None + daemon: Annotated[ + Optional[bool], + Field( + description=( + "Deamon will allow a workflow to proceed to the next step so long as" + " the container reaches readiness" + ) + ), + ] = None + dag: Annotated[ + Optional[DAGTemplate], + Field(description="DAG template subtype which runs a DAG"), + ] = None + data: Annotated[Optional[Data], Field(description="Data is a data template")] = None + executor: Annotated[ + Optional[ExecutorConfig], + Field(description="Executor holds configurations of the executor container."), + ] = None + fail_fast: Annotated[ + Optional[bool], + Field( + alias="failFast", + description=( + "FailFast, if specified, will fail this template if any of its child" + " pods has failed. This is useful for when this template is expanded" + " with `withItems`, etc." + ), + ), + ] = None + host_aliases: Annotated[ + Optional[List[v1.HostAlias]], + Field( + alias="hostAliases", + description=( + "HostAliases is an optional list of hosts and IPs that will be injected" " into the pod spec" + ), + ), + ] = None + http: Annotated[Optional[HTTP], Field(description="HTTP makes a HTTP request")] = None + init_containers: Annotated[ + Optional[List[UserContainer]], + Field( + alias="initContainers", + description=("InitContainers is a list of containers which run before the main" " container."), + ), + ] = None + inputs: Annotated[ + Optional[Inputs], + Field(description=("Inputs describe what inputs parameters and artifacts are supplied to" " this template")), + ] = None + memoize: Annotated[ + Optional[Memoize], + Field(description=("Memoize allows templates to use outputs generated from already" " executed templates")), + ] = None + metadata: Annotated[ + Optional[Metadata], + Field(description="Metdata sets the pods's metadata, i.e. annotations and labels"), + ] = None + metrics: Annotated[ + Optional[Metrics], + Field(description="Metrics are a list of metrics emitted from this template"), + ] = None + name: Annotated[Optional[str], Field(description="Name is the name of the template")] = None + node_selector: Annotated[ + Optional[Dict[str, str]], + Field( + alias="nodeSelector", + description=( + "NodeSelector is a selector to schedule this step of the workflow to be" + " run on the selected node(s). Overrides the selector set at the" + " workflow level." + ), + ), + ] = None + outputs: Annotated[ + Optional[Outputs], + Field(description=("Outputs describe the parameters and artifacts that this template" " produces")), + ] = None + parallelism: Annotated[ + Optional[int], + Field( + description=( + "Parallelism limits the max total parallel pods that can execute at the" + " same time within the boundaries of this template invocation. If" + " additional steps/dag templates are invoked, the pods created by those" + " templates will not be counted towards this total." + ) + ), + ] = None + plugin: Annotated[Optional[Plugin], Field(description="Plugin is a plugin template")] = None + pod_spec_patch: Annotated[ + Optional[str], + Field( + alias="podSpecPatch", + description=( + "PodSpecPatch holds strategic merge patch to apply against the pod" + " spec. Allows parameterization of container fields which are not" + " strings (e.g. resource limits)." + ), + ), + ] = None + priority: Annotated[Optional[int], Field(description="Priority to apply to workflow pods.")] = None + priority_class_name: Annotated[ + Optional[str], + Field( + alias="priorityClassName", + description="PriorityClassName to apply to workflow pods.", + ), + ] = None + resource: Annotated[ + Optional[ResourceTemplate], + Field(description="Resource template subtype which can run k8s resources"), + ] = None + retry_strategy: Annotated[ + Optional[RetryStrategy], + Field( + alias="retryStrategy", + description="RetryStrategy describes how to retry a template when it fails", + ), + ] = None + scheduler_name: Annotated[ + Optional[str], + Field( + alias="schedulerName", + description=( + "If specified, the pod will be dispatched by specified scheduler. Or it" + " will be dispatched by workflow scope scheduler if specified. If" + " neither specified, the pod will be dispatched by default scheduler." + ), + ), + ] = None + script: Annotated[ + Optional[ScriptTemplate], + Field(description="Script runs a portion of code against an interpreter"), + ] = None + security_context: Annotated[ + Optional[v1.PodSecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext holds pod-level security attributes and common" + " container settings. Optional: Defaults to empty. See type" + " description for default values of each field." + ), + ), + ] = None + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + description="ServiceAccountName to apply to workflow pods", + ), + ] = None + sidecars: Annotated[ + Optional[List[UserContainer]], + Field( + description=( + "Sidecars is a list of containers which run alongside the main" + " container Sidecars are automatically killed when the main container" + " completes" + ) + ), + ] = None + steps: Annotated[ + Optional[List[ParallelSteps]], + Field(description="Steps define a series of sequential/parallel workflow steps"), + ] = None + suspend: Annotated[ + Optional[SuspendTemplate], + Field(description=("Suspend template subtype which can suspend a workflow when reaching" " the step")), + ] = None + synchronization: Annotated[ + Optional[Synchronization], + Field(description=("Synchronization holds synchronization lock configuration for this" " template")), + ] = None + timeout: Annotated[ + Optional[str], + Field( + description=( + "Timeout allows to set the total node execution timeout duration" + " counting from the node's start time. This duration also includes time" + " in which the node spends in Pending state. This duration may not be" + " applied to Step or DAG templates." + ) + ), + ] = None + tolerations: Annotated[ + Optional[List[v1.Toleration]], + Field(description="Tolerations to apply to workflow pods."), + ] = None + volumes: Annotated[ + Optional[List[v1.Volume]], + Field(description=("Volumes is a list of volumes that can be mounted by containers in a" " template.")), + ] = None -class ParallelSteps(BaseModel): - __root__: List[WorkflowStep] +class DAGTask(BaseModel): + arguments: Annotated[ + Optional[Arguments], + Field(description=("Arguments are the parameter and artifact arguments to the template")), + ] = None + continue_on: Annotated[ + Optional[ContinueOn], + Field( + alias="continueOn", + description=( + "ContinueOn makes argo to proceed with the following step even if this" + " step fails. Errors and Failed states can be specified" + ), + ), + ] = None + dependencies: Annotated[ + Optional[List[str]], + Field(description="Dependencies are name of other targets which this depends on"), + ] = None + depends: Annotated[ + Optional[str], + Field(description="Depends are name of other targets which this depends on"), + ] = None + hooks: Annotated[ + Optional[Dict[str, LifecycleHook]], + Field( + description=( + "Hooks hold the lifecycle hook which is invoked at lifecycle of task," + " irrespective of the success, failure, or error status of the primary" + " task" + ) + ), + ] = None + inline: Annotated[ + Optional[Template], + Field(description=("Inline is the template. Template must be empty if this is declared" " (and vice-versa).")), + ] = None + name: Annotated[str, Field(description="Name is the name of the target")] + on_exit: Annotated[ + Optional[str], + Field( + alias="onExit", + description=( + "OnExit is a template reference which is invoked at the end of the" + " template, irrespective of the success, failure, or error of the" + " primary template. DEPRECATED: Use Hooks[exit].Template instead." + ), + ), + ] = None + template: Annotated[Optional[str], Field(description="Name of template to execute")] = None + template_ref: Annotated[ + Optional[TemplateRef], + Field( + alias="templateRef", + description=("TemplateRef is the reference to the template resource to execute."), + ), + ] = None + when: Annotated[ + Optional[str], + Field(description=("When is an expression in which the task should conditionally execute")), + ] = None + with_items: Annotated[ + Optional[List[Item]], + Field( + alias="withItems", + description=("WithItems expands a task into multiple parallel tasks from the items" " in the list"), + ), + ] = None + with_param: Annotated[ + Optional[str], + Field( + alias="withParam", + description=( + "WithParam expands a task into multiple parallel tasks from the value" + " in the parameter, which is expected to be a JSON list." + ), + ), + ] = None + with_sequence: Annotated[ + Optional[Sequence], + Field( + alias="withSequence", + description="WithSequence expands a task into a numeric sequence", + ), + ] = None -class Template(BaseModel): - active_deadline_seconds: Optional[intstr.IntOrString] = Field( - default=None, - alias="activeDeadlineSeconds", - description=( - "Optional duration in seconds relative to the StartTime that the pod may be" - " active on a node before the system actively tries to terminate the pod;" - " value must be positive integer This field is only applicable to container" - " and script templates." - ), - ) - affinity: Optional[v1.Affinity] = Field( - default=None, - description=( - "Affinity sets the pod's scheduling constraints Overrides the affinity set" - " at the workflow level (if any)" - ), - ) - archive_location: Optional[ArtifactLocation] = Field( - default=None, - alias="archiveLocation", - description=( - "Location in which all files related to the step will be stored (logs," - " artifacts, etc...). Can be overridden by individual items in Outputs. If" - " omitted, will use the default artifact repository location configured in" - " the controller, appended with the / in the key." - ), - ) - automount_service_account_token: Optional[bool] = Field( - default=None, - alias="automountServiceAccountToken", - description=( - "AutomountServiceAccountToken indicates whether a service account token" - " should be automatically mounted in pods. ServiceAccountName of" - " ExecutorConfig must be specified if this value is false." - ), - ) - container: Optional[v1.Container] = Field( - default=None, - description="Container is the main container image to run in the pod", - ) - container_set: Optional[ContainerSetTemplate] = Field( - default=None, - alias="containerSet", - description="ContainerSet groups multiple containers within a single pod.", - ) - daemon: Optional[bool] = Field( - default=None, - description=( - "Deamon will allow a workflow to proceed to the next step so long as the" " container reaches readiness" - ), - ) - dag: Optional[DAGTemplate] = Field(default=None, description="DAG template subtype which runs a DAG") - data: Optional[Data] = Field(default=None, description="Data is a data template") - executor: Optional[ExecutorConfig] = Field( - default=None, - description="Executor holds configurations of the executor container.", - ) - fail_fast: Optional[bool] = Field( - default=None, - alias="failFast", - description=( - "FailFast, if specified, will fail this template if any of its child pods" - " has failed. This is useful for when this template is expanded with" - " `withItems`, etc." - ), - ) - host_aliases: Optional[List[v1.HostAlias]] = Field( - default=None, - alias="hostAliases", - description=("HostAliases is an optional list of hosts and IPs that will be injected" " into the pod spec"), - ) - http: Optional[HTTP] = Field(default=None, description="HTTP makes a HTTP request") - init_containers: Optional[List[UserContainer]] = Field( - default=None, - alias="initContainers", - description=("InitContainers is a list of containers which run before the main" " container."), - ) - inputs: Optional[Inputs] = Field( - default=None, - description=("Inputs describe what inputs parameters and artifacts are supplied to this" " template"), - ) - memoize: Optional[Memoize] = Field( - default=None, - description=("Memoize allows templates to use outputs generated from already executed" " templates"), - ) - metadata: Optional[Metadata] = Field( - default=None, - description="Metdata sets the pods's metadata, i.e. annotations and labels", - ) - metrics: Optional[Metrics] = Field( - default=None, - description="Metrics are a list of metrics emitted from this template", - ) - name: Optional[str] = Field(default=None, description="Name is the name of the template") - node_selector: Optional[Dict[str, str]] = Field( - default=None, - alias="nodeSelector", - description=( - "NodeSelector is a selector to schedule this step of the workflow to be run" - " on the selected node(s). Overrides the selector set at the workflow" - " level." - ), - ) - outputs: Optional[Outputs] = Field( - default=None, - description=("Outputs describe the parameters and artifacts that this template produces"), - ) - parallelism: Optional[int] = Field( - default=None, - description=( - "Parallelism limits the max total parallel pods that can execute at the" - " same time within the boundaries of this template invocation. If" - " additional steps/dag templates are invoked, the pods created by those" - " templates will not be counted towards this total." - ), - ) - plugin: Optional[Plugin] = Field(default=None, description="Plugin is a plugin template") - pod_spec_patch: Optional[str] = Field( - default=None, - alias="podSpecPatch", - description=( - "PodSpecPatch holds strategic merge patch to apply against the pod spec." - " Allows parameterization of container fields which are not strings (e.g." - " resource limits)." - ), - ) - priority: Optional[int] = Field(default=None, description="Priority to apply to workflow pods.") - priority_class_name: Optional[str] = Field( - default=None, - alias="priorityClassName", - description="PriorityClassName to apply to workflow pods.", - ) - resource: Optional[ResourceTemplate] = Field( - default=None, - description="Resource template subtype which can run k8s resources", - ) - retry_strategy: Optional[RetryStrategy] = Field( - default=None, - alias="retryStrategy", - description="RetryStrategy describes how to retry a template when it fails", - ) - scheduler_name: Optional[str] = Field( - default=None, - alias="schedulerName", - description=( - "If specified, the pod will be dispatched by specified scheduler. Or it" - " will be dispatched by workflow scope scheduler if specified. If neither" - " specified, the pod will be dispatched by default scheduler." - ), - ) - script: Optional[ScriptTemplate] = Field( - default=None, description="Script runs a portion of code against an interpreter" - ) - security_context: Optional[v1.PodSecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext holds pod-level security attributes and common container" - " settings. Optional: Defaults to empty. See type description for default" - " values of each field." - ), - ) - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - description="ServiceAccountName to apply to workflow pods", - ) - sidecars: Optional[List[UserContainer]] = Field( - default=None, - description=( - "Sidecars is a list of containers which run alongside the main container" - " Sidecars are automatically killed when the main container completes" - ), - ) - steps: Optional[List[ParallelSteps]] = Field( - default=None, - description="Steps define a series of sequential/parallel workflow steps", - ) - suspend: Optional[SuspendTemplate] = Field( - default=None, - description=("Suspend template subtype which can suspend a workflow when reaching the" " step"), - ) - synchronization: Optional[Synchronization] = Field( - default=None, - description=("Synchronization holds synchronization lock configuration for this template"), - ) - timeout: Optional[str] = Field( - default=None, - description=( - "Timeout allows to set the total node execution timeout duration counting" - " from the node's start time. This duration also includes time in which the" - " node spends in Pending state. This duration may not be applied to Step or" - " DAG templates." - ), - ) - tolerations: Optional[List[v1.Toleration]] = Field( - default=None, description="Tolerations to apply to workflow pods." - ) - volumes: Optional[List[v1.Volume]] = Field( - default=None, - description=("Volumes is a list of volumes that can be mounted by containers in a" " template."), - ) +class WorkflowSpec(BaseModel): + active_deadline_seconds: Annotated[ + Optional[int], + Field( + alias="activeDeadlineSeconds", + description=( + "Optional duration in seconds relative to the workflow start time which" + " the workflow is allowed to run before the controller terminates the" + " io.argoproj.workflow.v1alpha1. A value of zero is used to terminate a" + " Running workflow" + ), + ), + ] = None + affinity: Annotated[ + Optional[v1.Affinity], + Field( + description=( + "Affinity sets the scheduling constraints for all pods in the" + " io.argoproj.workflow.v1alpha1. Can be overridden by an affinity" + " specified in the template" + ) + ), + ] = None + archive_logs: Annotated[ + Optional[bool], + Field( + alias="archiveLogs", + description=("ArchiveLogs indicates if the container logs should be archived"), + ), + ] = None + arguments: Annotated[ + Optional[Arguments], + Field( + description=( + "Arguments contain the parameters and artifacts sent to the workflow" + " entrypoint Parameters are referencable globally using the 'workflow'" + " variable prefix. e.g." + " {{io.argoproj.workflow.v1alpha1.parameters.myparam}}" + ) + ), + ] = None + artifact_gc: Annotated[ + Optional[ArtifactGC], + Field( + alias="artifactGC", + description=( + "ArtifactGC describes the strategy to use when deleting artifacts from" + " completed or deleted workflows (applies to all output Artifacts" + " unless Artifact.ArtifactGC is specified, which overrides this)" + ), + ), + ] = None + artifact_repository_ref: Annotated[ + Optional[ArtifactRepositoryRef], + Field( + alias="artifactRepositoryRef", + description=( + "ArtifactRepositoryRef specifies the configMap name and key containing" + " the artifact repository config." + ), + ), + ] = None + automount_service_account_token: Annotated[ + Optional[bool], + Field( + alias="automountServiceAccountToken", + description=( + "AutomountServiceAccountToken indicates whether a service account token" + " should be automatically mounted in pods. ServiceAccountName of" + " ExecutorConfig must be specified if this value is false." + ), + ), + ] = None + dns_config: Annotated[ + Optional[v1.PodDNSConfig], + Field( + alias="dnsConfig", + description=( + "PodDNSConfig defines the DNS parameters of a pod in addition to those" " generated from DNSPolicy." + ), + ), + ] = None + dns_policy: Annotated[ + Optional[str], + Field( + alias="dnsPolicy", + description=( + 'Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values' + " are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or" + " 'None'. DNS parameters given in DNSConfig will be merged with the" + " policy selected with DNSPolicy. To have DNS options set along with" + " hostNetwork, you have to specify DNS policy explicitly to" + " 'ClusterFirstWithHostNet'." + ), + ), + ] = None + entrypoint: Annotated[ + Optional[str], + Field( + description=( + "Entrypoint is a template reference to the starting point of the" " io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + executor: Annotated[ + Optional[ExecutorConfig], + Field( + description=( + "Executor holds configurations of executor containers of the" " io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + hooks: Annotated[ + Optional[Dict[str, LifecycleHook]], + Field( + description=( + "Hooks holds the lifecycle hook which is invoked at lifecycle of step," + " irrespective of the success, failure, or error status of the primary" + " step" + ) + ), + ] = None + host_aliases: Annotated[Optional[List[v1.HostAlias]], Field(alias="hostAliases")] = None + host_network: Annotated[ + Optional[bool], + Field( + alias="hostNetwork", + description=("Host networking requested for this workflow pod. Default to false."), + ), + ] = None + image_pull_secrets: Annotated[ + Optional[List[v1.LocalObjectReference]], + Field( + alias="imagePullSecrets", + description=( + "ImagePullSecrets is a list of references to secrets in the same" + " namespace to use for pulling any images in pods that reference this" + " ServiceAccount. ImagePullSecrets are distinct from Secrets because" + " Secrets can be mounted in the pod, but ImagePullSecrets are only" + " accessed by the kubelet. More info:" + " https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod" + ), + ), + ] = None + metrics: Annotated[ + Optional[Metrics], + Field(description="Metrics are a list of metrics emitted from this Workflow"), + ] = None + node_selector: Annotated[ + Optional[Dict[str, str]], + Field( + alias="nodeSelector", + description=( + "NodeSelector is a selector which will result in all pods of the" + " workflow to be scheduled on the selected node(s). This is able to be" + " overridden by a nodeSelector specified in the template." + ), + ), + ] = None + on_exit: Annotated[ + Optional[str], + Field( + alias="onExit", + description=( + "OnExit is a template reference which is invoked at the end of the" + " workflow, irrespective of the success, failure, or error of the" + " primary io.argoproj.workflow.v1alpha1." + ), + ), + ] = None + parallelism: Annotated[ + Optional[int], + Field( + description=( + "Parallelism limits the max total parallel pods that can execute at the" " same time in a workflow" + ) + ), + ] = None + pod_disruption_budget: Annotated[ + Optional[v1beta1.PodDisruptionBudgetSpec], + Field( + alias="podDisruptionBudget", + description=( + "PodDisruptionBudget holds the number of concurrent disruptions that" + " you allow for Workflow's Pods. Controller will automatically add the" + " selector with workflow name, if selector is empty. Optional: Defaults" + " to empty." + ), + ), + ] = None + pod_gc: Annotated[ + Optional[PodGC], + Field( + alias="podGC", + description=("PodGC describes the strategy to use when deleting completed pods"), + ), + ] = None + pod_metadata: Annotated[ + Optional[Metadata], + Field( + alias="podMetadata", + description=("PodMetadata defines additional metadata that should be applied to" " workflow pods"), + ), + ] = None + pod_priority: Annotated[ + Optional[int], + Field( + alias="podPriority", + description=("Priority to apply to workflow pods. DEPRECATED: Use" " PodPriorityClassName instead."), + ), + ] = None + pod_priority_class_name: Annotated[ + Optional[str], + Field( + alias="podPriorityClassName", + description="PriorityClassName to apply to workflow pods.", + ), + ] = None + pod_spec_patch: Annotated[ + Optional[str], + Field( + alias="podSpecPatch", + description=( + "PodSpecPatch holds strategic merge patch to apply against the pod" + " spec. Allows parameterization of container fields which are not" + " strings (e.g. resource limits)." + ), + ), + ] = None + priority: Annotated[ + Optional[int], + Field( + description=( + "Priority is used if controller is configured to process limited number" + " of workflows in parallel. Workflows with higher priority are" + " processed first." + ) + ), + ] = None + retry_strategy: Annotated[ + Optional[RetryStrategy], + Field( + alias="retryStrategy", + description=("RetryStrategy for all templates in the io.argoproj.workflow.v1alpha1."), + ), + ] = None + scheduler_name: Annotated[ + Optional[str], + Field( + alias="schedulerName", + description=( + "Set scheduler name for all pods. Will be overridden if" + " container/script template's scheduler name is set. Default scheduler" + " will be used if neither specified." + ), + ), + ] = None + security_context: Annotated[ + Optional[v1.PodSecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext holds pod-level security attributes and common" + " container settings. Optional: Defaults to empty. See type" + " description for default values of each field." + ), + ), + ] = None + service_account_name: Annotated[ + Optional[str], + Field( + alias="serviceAccountName", + description=( + "ServiceAccountName is the name of the ServiceAccount to run all pods" " of the workflow as." + ), + ), + ] = None + shutdown: Annotated[ + Optional[str], + Field(description=("Shutdown will shutdown the workflow according to its ShutdownStrategy")), + ] = None + suspend: Annotated[ + Optional[bool], + Field( + description=( + "Suspend will suspend the workflow and prevent execution of any future" " steps in the workflow" + ) + ), + ] = None + synchronization: Annotated[ + Optional[Synchronization], + Field(description=("Synchronization holds synchronization lock configuration for this" " Workflow")), + ] = None + template_defaults: Annotated[ + Optional[Template], + Field( + alias="templateDefaults", + description=( + "TemplateDefaults holds default template values that will apply to all" + " templates in the Workflow, unless overridden on the template-level" + ), + ), + ] = None + templates: Annotated[ + Optional[List[Template]], + Field(description="Templates is a list of workflow templates used in a workflow"), + ] = None + tolerations: Annotated[ + Optional[List[v1.Toleration]], + Field(description="Tolerations to apply to workflow pods."), + ] = None + ttl_strategy: Annotated[ + Optional[TTLStrategy], + Field( + alias="ttlStrategy", + description=( + "TTLStrategy limits the lifetime of a Workflow that has finished" + " execution depending on if it Succeeded or Failed. If this struct is" + " set, once the Workflow finishes, it will be deleted after the time to" + " live expires. If this field is unset, the controller config map will" + " hold the default values." + ), + ), + ] = None + volume_claim_gc: Annotated[ + Optional[VolumeClaimGC], + Field( + alias="volumeClaimGC", + description=( + "VolumeClaimGC describes the strategy to use when deleting volumes from" " completed workflows" + ), + ), + ] = None + volume_claim_templates: Annotated[ + Optional[List[v1.PersistentVolumeClaim]], + Field( + alias="volumeClaimTemplates", + description=( + "VolumeClaimTemplates is a list of claims that containers are allowed" + " to reference. The Workflow controller will create the claims at the" + " beginning of the workflow and delete the claims upon completion of" + " the workflow" + ), + ), + ] = None + volumes: Annotated[ + Optional[List[v1.Volume]], + Field( + description=( + "Volumes is a list of volumes that can be mounted by containers in a" " io.argoproj.workflow.v1alpha1." + ) + ), + ] = None + workflow_metadata: Annotated[ + Optional[WorkflowMetadata], + Field( + alias="workflowMetadata", + description=("WorkflowMetadata contains some metadata of the workflow to refer to"), + ), + ] = None + workflow_template_ref: Annotated[ + Optional[WorkflowTemplateRef], + Field( + alias="workflowTemplateRef", + description=("WorkflowTemplateRef holds a reference to a WorkflowTemplate for" " execution"), + ), + ] = None -class UpdateCronWorkflowRequest(BaseModel): - cron_workflow: Optional[CronWorkflow] = Field(default=None, alias="cronWorkflow") - name: Optional[str] = Field(default=None, description="DEPRECATED: This field is ignored.") - namespace: Optional[str] = None +class WorkflowStep(BaseModel): + arguments: Annotated[ + Optional[Arguments], + Field(description="Arguments hold arguments to the template"), + ] = None + continue_on: Annotated[ + Optional[ContinueOn], + Field( + alias="continueOn", + description=( + "ContinueOn makes argo to proceed with the following step even if this" + " step fails. Errors and Failed states can be specified" + ), + ), + ] = None + hooks: Annotated[ + Optional[Dict[str, LifecycleHook]], + Field( + description=( + "Hooks holds the lifecycle hook which is invoked at lifecycle of step," + " irrespective of the success, failure, or error status of the primary" + " step" + ) + ), + ] = None + inline: Annotated[ + Optional[Template], + Field(description=("Inline is the template. Template must be empty if this is declared" " (and vice-versa).")), + ] = None + name: Annotated[Optional[str], Field(description="Name of the step")] = None + on_exit: Annotated[ + Optional[str], + Field( + alias="onExit", + description=( + "OnExit is a template reference which is invoked at the end of the" + " template, irrespective of the success, failure, or error of the" + " primary template. DEPRECATED: Use Hooks[exit].Template instead." + ), + ), + ] = None + template: Annotated[ + Optional[str], + Field(description="Template is the name of the template to execute as the step"), + ] = None + template_ref: Annotated[ + Optional[TemplateRef], + Field( + alias="templateRef", + description=("TemplateRef is the reference to the template resource to execute as" " the step."), + ), + ] = None + when: Annotated[ + Optional[str], + Field(description=("When is an expression in which the step should conditionally execute")), + ] = None + with_items: Annotated[ + Optional[List[Item]], + Field( + alias="withItems", + description=("WithItems expands a step into multiple parallel steps from the items" " in the list"), + ), + ] = None + with_param: Annotated[ + Optional[str], + Field( + alias="withParam", + description=( + "WithParam expands a step into multiple parallel steps from the value" + " in the parameter, which is expected to be a JSON list." + ), + ), + ] = None + with_sequence: Annotated[ + Optional[Sequence], + Field( + alias="withSequence", + description="WithSequence expands a step into a numeric sequence", + ), + ] = None -class Workflow(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) +class ClusterWorkflowTemplate(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ObjectMeta spec: WorkflowSpec - status: Optional[WorkflowStatus] = None -class WorkflowCreateRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") - instance_id: Optional[str] = Field(default=None, alias="instanceID", description="This field is no longer used.") - namespace: Optional[str] = None - server_dry_run: Optional[bool] = Field(default=None, alias="serverDryRun") - workflow: Optional[Workflow] = None +class CronWorkflowSpec(BaseModel): + concurrency_policy: Annotated[ + Optional[str], + Field( + alias="concurrencyPolicy", + description=("ConcurrencyPolicy is the K8s-style concurrency policy that will be" " used"), + ), + ] = None + failed_jobs_history_limit: Annotated[ + Optional[int], + Field( + alias="failedJobsHistoryLimit", + description=("FailedJobsHistoryLimit is the number of failed jobs to be kept at a" " time"), + ), + ] = None + schedule: Annotated[ + str, + Field(description="Schedule is a schedule to run the Workflow in Cron format"), + ] + starting_deadline_seconds: Annotated[ + Optional[int], + Field( + alias="startingDeadlineSeconds", + description=( + "StartingDeadlineSeconds is the K8s-style deadline that will limit the" + " time a CronWorkflow will be run after its original scheduled time if" + " it is missed." + ), + ), + ] = None + successful_jobs_history_limit: Annotated[ + Optional[int], + Field( + alias="successfulJobsHistoryLimit", + description=("SuccessfulJobsHistoryLimit is the number of successful jobs to be kept" " at a time"), + ), + ] = None + suspend: Annotated[ + Optional[bool], + Field(description=("Suspend is a flag that will stop new CronWorkflows from running if set" " to true")), + ] = None + timezone: Annotated[ + Optional[str], + Field( + description=( + "Timezone is the timezone against which the cron schedule will be" + ' calculated, e.g. "Asia/Tokyo". Default is machine\'s local time.' + ) + ), + ] = None + workflow_metadata: Annotated[ + Optional[v1_1.ObjectMeta], + Field( + alias="workflowMetadata", + description=("WorkflowMetadata contains some metadata of the workflow to be run"), + ), + ] = None + workflow_spec: Annotated[ + WorkflowSpec, + Field( + alias="workflowSpec", + description="WorkflowSpec is the spec of the workflow to be run", + ), + ] -class WorkflowLintRequest(BaseModel): - namespace: Optional[str] = None - workflow: Optional[Workflow] = None +class WorkflowStatus(BaseModel): + artifact_gc_status: Annotated[ + Optional[ArtGCStatus], + Field( + alias="artifactGCStatus", + description=("ArtifactGCStatus maintains the status of Artifact Garbage Collection"), + ), + ] = None + artifact_repository_ref: Annotated[ + Optional[ArtifactRepositoryRefStatus], + Field( + alias="artifactRepositoryRef", + description=( + "ArtifactRepositoryRef is used to cache the repository to use so we do" + " not need to determine it everytime we reconcile." + ), + ), + ] = None + compressed_nodes: Annotated[ + Optional[str], + Field( + alias="compressedNodes", + description="Compressed and base64 decoded Nodes map", + ), + ] = None + conditions: Annotated[ + Optional[List[Condition]], + Field(description="Conditions is a list of conditions the Workflow may have"), + ] = None + estimated_duration: Annotated[ + Optional[int], + Field(alias="estimatedDuration", description="EstimatedDuration in seconds."), + ] = None + finished_at: Annotated[ + Optional[v1_1.Time], + Field(alias="finishedAt", description="Time at which this workflow completed"), + ] = None + message: Annotated[ + Optional[str], + Field( + description=("A human readable message indicating details about why the workflow is" " in this condition.") + ), + ] = None + nodes: Annotated[ + Optional[Dict[str, NodeStatus]], + Field(description="Nodes is a mapping between a node ID and the node's status."), + ] = None + offload_node_status_version: Annotated[ + Optional[str], + Field( + alias="offloadNodeStatusVersion", + description=( + "Whether on not node status has been offloaded to a database. If" + " exists, then Nodes and CompressedNodes will be empty. This will" + " actually be populated with a hash of the offloaded data." + ), + ), + ] = None + outputs: Annotated[ + Optional[Outputs], + Field( + description=( + "Outputs captures output values and artifact locations produced by the" " workflow via global outputs" + ) + ), + ] = None + persistent_volume_claims: Annotated[ + Optional[List[v1.Volume]], + Field( + alias="persistentVolumeClaims", + description=( + "PersistentVolumeClaims tracks all PVCs that were created as part of" + " the io.argoproj.workflow.v1alpha1. The contents of this list are" + " drained at the end of the workflow." + ), + ), + ] = None + phase: Annotated[ + Optional[str], + Field(description=("Phase a simple, high-level summary of where the workflow is in its" " lifecycle.")), + ] = None + progress: Annotated[Optional[str], Field(description="Progress to completion")] = None + resources_duration: Annotated[ + Optional[Dict[str, int]], + Field( + alias="resourcesDuration", + description="ResourcesDuration is the total for the workflow", + ), + ] = None + started_at: Annotated[ + Optional[v1_1.Time], + Field(alias="startedAt", description="Time at which this workflow started"), + ] = None + stored_templates: Annotated[ + Optional[Dict[str, Template]], + Field( + alias="storedTemplates", + description=("StoredTemplates is a mapping between a template ref and the node's" " status."), + ), + ] = None + stored_workflow_template_spec: Annotated[ + Optional[WorkflowSpec], + Field( + alias="storedWorkflowTemplateSpec", + description=("StoredWorkflowSpec stores the WorkflowTemplate spec for future" " execution."), + ), + ] = None + synchronization: Annotated[ + Optional[SynchronizationStatus], + Field(description="Synchronization stores the status of synchronization locks"), + ] = None -class WorkflowList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[Workflow]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ListMeta +class WorkflowTemplate(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ObjectMeta + spec: WorkflowSpec -class WorkflowSpec(BaseModel): - active_deadline_seconds: Optional[int] = Field( - default=None, - alias="activeDeadlineSeconds", - description=( - "Optional duration in seconds relative to the workflow start time which the" - " workflow is allowed to run before the controller terminates the" - " io.argoproj.workflow.v1alpha1. A value of zero is used to terminate a" - " Running workflow" - ), - ) - affinity: Optional[v1.Affinity] = Field( - default=None, - description=( - "Affinity sets the scheduling constraints for all pods in the" - " io.argoproj.workflow.v1alpha1. Can be overridden by an affinity specified" - " in the template" - ), - ) - archive_logs: Optional[bool] = Field( - default=None, - alias="archiveLogs", - description="ArchiveLogs indicates if the container logs should be archived", - ) - arguments: Optional[Arguments] = Field( - default=None, - description=( - "Arguments contain the parameters and artifacts sent to the workflow" - " entrypoint Parameters are referencable globally using the 'workflow'" - " variable prefix. e.g." - " {{io.argoproj.workflow.v1alpha1.parameters.myparam}}" - ), - ) - artifact_gc: Optional[ArtifactGC] = Field( - default=None, - alias="artifactGC", - description=( - "ArtifactGC describes the strategy to use when deleting artifacts from" - " completed or deleted workflows (applies to all output Artifacts unless" - " Artifact.ArtifactGC is specified, which overrides this)" - ), - ) - artifact_repository_ref: Optional[ArtifactRepositoryRef] = Field( - default=None, - alias="artifactRepositoryRef", - description=( - "ArtifactRepositoryRef specifies the configMap name and key containing the" " artifact repository config." - ), - ) - automount_service_account_token: Optional[bool] = Field( - default=None, - alias="automountServiceAccountToken", - description=( - "AutomountServiceAccountToken indicates whether a service account token" - " should be automatically mounted in pods. ServiceAccountName of" - " ExecutorConfig must be specified if this value is false." - ), - ) - dns_config: Optional[v1.PodDNSConfig] = Field( - default=None, - alias="dnsConfig", - description=( - "PodDNSConfig defines the DNS parameters of a pod in addition to those" " generated from DNSPolicy." - ), - ) - dns_policy: Optional[str] = Field( - default=None, - alias="dnsPolicy", - description=( - 'Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values are' - " 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'." - " DNS parameters given in DNSConfig will be merged with the policy selected" - " with DNSPolicy. To have DNS options set along with hostNetwork, you have" - " to specify DNS policy explicitly to 'ClusterFirstWithHostNet'." - ), - ) - entrypoint: Optional[str] = Field( - default=None, - description=( - "Entrypoint is a template reference to the starting point of the" " io.argoproj.workflow.v1alpha1." - ), - ) - executor: Optional[ExecutorConfig] = Field( - default=None, - description=("Executor holds configurations of executor containers of the" " io.argoproj.workflow.v1alpha1."), - ) - hooks: Optional[Dict[str, LifecycleHook]] = Field( - default=None, - description=( - "Hooks holds the lifecycle hook which is invoked at lifecycle of step," - " irrespective of the success, failure, or error status of the primary step" - ), - ) - host_aliases: Optional[List[v1.HostAlias]] = Field(default=None, alias="hostAliases") - host_network: Optional[bool] = Field( - default=None, - alias="hostNetwork", - description=("Host networking requested for this workflow pod. Default to false."), - ) - image_pull_secrets: Optional[List[v1.LocalObjectReference]] = Field( - default=None, - alias="imagePullSecrets", - description=( - "ImagePullSecrets is a list of references to secrets in the same namespace" - " to use for pulling any images in pods that reference this ServiceAccount." - " ImagePullSecrets are distinct from Secrets because Secrets can be mounted" - " in the pod, but ImagePullSecrets are only accessed by the kubelet. More" - " info:" - " https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod" - ), - ) - metrics: Optional[Metrics] = Field( - default=None, - description="Metrics are a list of metrics emitted from this Workflow", - ) - node_selector: Optional[Dict[str, str]] = Field( - default=None, - alias="nodeSelector", - description=( - "NodeSelector is a selector which will result in all pods of the workflow" - " to be scheduled on the selected node(s). This is able to be overridden by" - " a nodeSelector specified in the template." - ), - ) - on_exit: Optional[str] = Field( - default=None, - alias="onExit", - description=( - "OnExit is a template reference which is invoked at the end of the" - " workflow, irrespective of the success, failure, or error of the primary" - " io.argoproj.workflow.v1alpha1." - ), - ) - parallelism: Optional[int] = Field( - default=None, - description=( - "Parallelism limits the max total parallel pods that can execute at the" " same time in a workflow" - ), - ) - pod_disruption_budget: Optional[v1beta1.PodDisruptionBudgetSpec] = Field( - default=None, - alias="podDisruptionBudget", - description=( - "PodDisruptionBudget holds the number of concurrent disruptions that you" - " allow for Workflow's Pods. Controller will automatically add the selector" - " with workflow name, if selector is empty. Optional: Defaults to empty." - ), - ) - pod_gc: Optional[PodGC] = Field( - default=None, - alias="podGC", - description="PodGC describes the strategy to use when deleting completed pods", - ) - pod_metadata: Optional[Metadata] = Field( - default=None, - alias="podMetadata", - description=("PodMetadata defines additional metadata that should be applied to workflow" " pods"), - ) - pod_priority: Optional[int] = Field( - default=None, - alias="podPriority", - description=("Priority to apply to workflow pods. DEPRECATED: Use PodPriorityClassName" " instead."), - ) - pod_priority_class_name: Optional[str] = Field( - default=None, - alias="podPriorityClassName", - description="PriorityClassName to apply to workflow pods.", - ) - pod_spec_patch: Optional[str] = Field( - default=None, - alias="podSpecPatch", - description=( - "PodSpecPatch holds strategic merge patch to apply against the pod spec." - " Allows parameterization of container fields which are not strings (e.g." - " resource limits)." - ), - ) - priority: Optional[int] = Field( - default=None, - description=( - "Priority is used if controller is configured to process limited number of" - " workflows in parallel. Workflows with higher priority are processed" - " first." - ), - ) - retry_strategy: Optional[RetryStrategy] = Field( - default=None, - alias="retryStrategy", - description=("RetryStrategy for all templates in the io.argoproj.workflow.v1alpha1."), - ) - scheduler_name: Optional[str] = Field( - default=None, - alias="schedulerName", - description=( - "Set scheduler name for all pods. Will be overridden if container/script" - " template's scheduler name is set. Default scheduler will be used if" - " neither specified." - ), - ) - security_context: Optional[v1.PodSecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext holds pod-level security attributes and common container" - " settings. Optional: Defaults to empty. See type description for default" - " values of each field." - ), - ) - service_account_name: Optional[str] = Field( - default=None, - alias="serviceAccountName", - description=("ServiceAccountName is the name of the ServiceAccount to run all pods of" " the workflow as."), - ) - shutdown: Optional[str] = Field( - default=None, - description=("Shutdown will shutdown the workflow according to its ShutdownStrategy"), - ) - suspend: Optional[bool] = Field( - default=None, - description=("Suspend will suspend the workflow and prevent execution of any future" " steps in the workflow"), - ) - synchronization: Optional[Synchronization] = Field( - default=None, - description=("Synchronization holds synchronization lock configuration for this Workflow"), - ) - template_defaults: Optional[Template] = Field( - default=None, - alias="templateDefaults", - description=( - "TemplateDefaults holds default template values that will apply to all" - " templates in the Workflow, unless overridden on the template-level" - ), - ) - templates: Optional[List[Template]] = Field( - default=None, - description="Templates is a list of workflow templates used in a workflow", - ) - tolerations: Optional[List[v1.Toleration]] = Field( - default=None, description="Tolerations to apply to workflow pods." - ) - ttl_strategy: Optional[TTLStrategy] = Field( - default=None, - alias="ttlStrategy", - description=( - "TTLStrategy limits the lifetime of a Workflow that has finished execution" - " depending on if it Succeeded or Failed. If this struct is set, once the" - " Workflow finishes, it will be deleted after the time to live expires. If" - " this field is unset, the controller config map will hold the default" - " values." - ), - ) - volume_claim_gc: Optional[VolumeClaimGC] = Field( - default=None, - alias="volumeClaimGC", - description=("VolumeClaimGC describes the strategy to use when deleting volumes from" " completed workflows"), - ) - volume_claim_templates: Optional[List[v1.PersistentVolumeClaim]] = Field( - default=None, - alias="volumeClaimTemplates", - description=( - "VolumeClaimTemplates is a list of claims that containers are allowed to" - " reference. The Workflow controller will create the claims at the" - " beginning of the workflow and delete the claims upon completion of the" - " workflow" - ), - ) - volumes: Optional[List[v1.Volume]] = Field( - default=None, - description=( - "Volumes is a list of volumes that can be mounted by containers in a" " io.argoproj.workflow.v1alpha1." - ), - ) - workflow_metadata: Optional[WorkflowMetadata] = Field( - default=None, - alias="workflowMetadata", - description=("WorkflowMetadata contains some metadata of the workflow to refer to"), - ) - workflow_template_ref: Optional[WorkflowTemplateRef] = Field( - default=None, - alias="workflowTemplateRef", - description=("WorkflowTemplateRef holds a reference to a WorkflowTemplate for execution"), - ) +class ClusterWorkflowTemplateCreateRequest(BaseModel): + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None + template: Optional[ClusterWorkflowTemplate] = None -class WorkflowStatus(BaseModel): - artifact_gc_status: Optional[ArtGCStatus] = Field( - default=None, - alias="artifactGCStatus", - description=("ArtifactGCStatus maintains the status of Artifact Garbage Collection"), - ) - artifact_repository_ref: Optional[ArtifactRepositoryRefStatus] = Field( - default=None, - alias="artifactRepositoryRef", - description=( - "ArtifactRepositoryRef is used to cache the repository to use so we do not" - " need to determine it everytime we reconcile." - ), - ) - compressed_nodes: Optional[str] = Field( - default=None, - alias="compressedNodes", - description="Compressed and base64 decoded Nodes map", - ) - conditions: Optional[List[Condition]] = Field( - default=None, - description="Conditions is a list of conditions the Workflow may have", - ) - estimated_duration: Optional[int] = Field( - default=None, - alias="estimatedDuration", - description="EstimatedDuration in seconds.", - ) - finished_at: Optional[v1_1.Time] = Field( - default=None, - alias="finishedAt", - description="Time at which this workflow completed", - ) - message: Optional[str] = Field( - default=None, - description=("A human readable message indicating details about why the workflow is in" " this condition."), - ) - nodes: Optional[Dict[str, NodeStatus]] = Field( - default=None, - description="Nodes is a mapping between a node ID and the node's status.", - ) - offload_node_status_version: Optional[str] = Field( - default=None, - alias="offloadNodeStatusVersion", - description=( - "Whether on not node status has been offloaded to a database. If exists," - " then Nodes and CompressedNodes will be empty. This will actually be" - " populated with a hash of the offloaded data." - ), - ) - outputs: Optional[Outputs] = Field( - default=None, - description=( - "Outputs captures output values and artifact locations produced by the" " workflow via global outputs" - ), - ) - persistent_volume_claims: Optional[List[v1.Volume]] = Field( - default=None, - alias="persistentVolumeClaims", - description=( - "PersistentVolumeClaims tracks all PVCs that were created as part of the" - " io.argoproj.workflow.v1alpha1. The contents of this list are drained at" - " the end of the workflow." - ), - ) - phase: Optional[str] = Field( - default=None, - description=("Phase a simple, high-level summary of where the workflow is in its" " lifecycle."), - ) - progress: Optional[str] = Field(default=None, description="Progress to completion") - resources_duration: Optional[Dict[str, int]] = Field( - default=None, - alias="resourcesDuration", - description="ResourcesDuration is the total for the workflow", - ) - started_at: Optional[v1_1.Time] = Field( - default=None, - alias="startedAt", - description="Time at which this workflow started", - ) - stored_templates: Optional[Dict[str, Template]] = Field( - default=None, - alias="storedTemplates", - description=("StoredTemplates is a mapping between a template ref and the node's status."), - ) - stored_workflow_template_spec: Optional[WorkflowSpec] = Field( - default=None, - alias="storedWorkflowTemplateSpec", - description=("StoredWorkflowSpec stores the WorkflowTemplate spec for future execution."), - ) - synchronization: Optional[SynchronizationStatus] = Field( - default=None, - description="Synchronization stores the status of synchronization locks", - ) +class ClusterWorkflowTemplateLintRequest(BaseModel): + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None + template: Optional[ClusterWorkflowTemplate] = None -class WorkflowStep(BaseModel): - arguments: Optional[Arguments] = Field(default=None, description="Arguments hold arguments to the template") - continue_on: Optional[ContinueOn] = Field( - default=None, - alias="continueOn", - description=( - "ContinueOn makes argo to proceed with the following step even if this step" - " fails. Errors and Failed states can be specified" - ), - ) - hooks: Optional[Dict[str, LifecycleHook]] = Field( - default=None, - description=( - "Hooks holds the lifecycle hook which is invoked at lifecycle of step," - " irrespective of the success, failure, or error status of the primary step" - ), - ) - inline: Optional[Template] = Field( - default=None, - description=("Inline is the template. Template must be empty if this is declared (and" " vice-versa)."), - ) - name: Optional[str] = Field(default=None, description="Name of the step") - on_exit: Optional[str] = Field( - default=None, - alias="onExit", - description=( - "OnExit is a template reference which is invoked at the end of the" - " template, irrespective of the success, failure, or error of the primary" - " template. DEPRECATED: Use Hooks[exit].Template instead." - ), - ) - template: Optional[str] = Field( - default=None, - description="Template is the name of the template to execute as the step", - ) - template_ref: Optional[TemplateRef] = Field( - default=None, - alias="templateRef", - description=("TemplateRef is the reference to the template resource to execute as the" " step."), - ) - when: Optional[str] = Field( - default=None, - description=("When is an expression in which the step should conditionally execute"), - ) - with_items: Optional[List[Item]] = Field( - default=None, - alias="withItems", - description=("WithItems expands a step into multiple parallel steps from the items in" " the list"), - ) - with_param: Optional[str] = Field( - default=None, - alias="withParam", - description=( - "WithParam expands a step into multiple parallel steps from the value in" - " the parameter, which is expected to be a JSON list." - ), - ) - with_sequence: Optional[Sequence] = Field( - default=None, - alias="withSequence", - description="WithSequence expands a step into a numeric sequence", - ) +class ClusterWorkflowTemplateUpdateRequest(BaseModel): + name: Annotated[Optional[str], Field(description="DEPRECATED: This field is ignored.")] = None + template: Optional[ClusterWorkflowTemplate] = None -class WorkflowTaskSetSpec(BaseModel): - tasks: Optional[Dict[str, Template]] = None +class CronWorkflow(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: v1_1.ObjectMeta + spec: CronWorkflowSpec + status: Optional[CronWorkflowStatus] = None -class WorkflowTemplate(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) +class Workflow(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None metadata: v1_1.ObjectMeta spec: WorkflowSpec + status: Optional[WorkflowStatus] = None class WorkflowTemplateCreateRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None namespace: Optional[str] = None template: Optional[WorkflowTemplate] = None class WorkflowTemplateLintRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] = Field(default=None, alias="createOptions") + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None namespace: Optional[str] = None template: Optional[WorkflowTemplate] = None -class WorkflowTemplateList(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - items: Optional[List[WorkflowTemplate]] = None - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: v1_1.ListMeta - - class WorkflowTemplateUpdateRequest(BaseModel): - name: Optional[str] = Field(default=None, description="DEPRECATED: This field is ignored.") + name: Annotated[Optional[str], Field(description="DEPRECATED: This field is ignored.")] = None namespace: Optional[str] = None template: Optional[WorkflowTemplate] = None +class CreateCronWorkflowRequest(BaseModel): + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None + cron_workflow: Annotated[Optional[CronWorkflow], Field(alias="cronWorkflow")] = None + namespace: Optional[str] = None + + +class LintCronWorkflowRequest(BaseModel): + cron_workflow: Annotated[Optional[CronWorkflow], Field(alias="cronWorkflow")] = None + namespace: Optional[str] = None + + +class UpdateCronWorkflowRequest(BaseModel): + cron_workflow: Annotated[Optional[CronWorkflow], Field(alias="cronWorkflow")] = None + name: Annotated[Optional[str], Field(description="DEPRECATED: This field is ignored.")] = None + namespace: Optional[str] = None + + +class WorkflowCreateRequest(BaseModel): + create_options: Annotated[Optional[v1_1.CreateOptions], Field(alias="createOptions")] = None + instance_id: Annotated[ + Optional[str], + Field(alias="instanceID", description="This field is no longer used."), + ] = None + namespace: Optional[str] = None + server_dry_run: Annotated[Optional[bool], Field(alias="serverDryRun")] = None + workflow: Optional[Workflow] = None + + +class WorkflowLintRequest(BaseModel): + namespace: Optional[str] = None + workflow: Optional[Workflow] = None + + class WorkflowWatchEvent(BaseModel): - object: Optional[Workflow] = Field(default=None, title="the workflow") - type: Optional[str] = Field(default=None, title="the type of change") + object: Annotated[Optional[Workflow], Field(title="the workflow")] = None + type: Annotated[Optional[str], Field(title="the type of change")] = None -ClusterWorkflowTemplate.update_forward_refs() -CreateCronWorkflowRequest.update_forward_refs() -CronWorkflow.update_forward_refs() -CronWorkflowSpec.update_forward_refs() -DAGTask.update_forward_refs() +DAGTemplate.update_forward_refs() ParallelSteps.update_forward_refs() -Workflow.update_forward_refs() +WorkflowTaskSetSpec.update_forward_refs() +ClusterWorkflowTemplateList.update_forward_refs() +CronWorkflowList.update_forward_refs() +WorkflowList.update_forward_refs() +WorkflowTemplateList.update_forward_refs() diff --git a/src/hera/workflows/models/io/argoproj/workflow/v1alpha1.pyi b/src/hera/workflows/models/io/argoproj/workflow/v1alpha1.pyi deleted file mode 100644 index 09c3fff3b..000000000 --- a/src/hera/workflows/models/io/argoproj/workflow/v1alpha1.pyi +++ /dev/null @@ -1,1087 +0,0 @@ -from typing import Any, Dict, List, Optional - -from hera.shared._pydantic import ( - BaseModel as BaseModel, - Field as Field, -) - -from ...k8s.api.core import v1 as v1 -from ...k8s.api.policy import v1beta1 as v1beta1 -from ...k8s.apimachinery.pkg.apis.meta import v1 as v1_1 -from ...k8s.apimachinery.pkg.util import intstr as intstr - -class Amount(BaseModel): - __root__: float - -class ArchivedWorkflowDeletedResponse(BaseModel): ... - -class ArtGCStatus(BaseModel): - not_specified: Optional[bool] - pods_recouped: Optional[Dict[str, bool]] - strategies_processed: Optional[Dict[str, bool]] - -class ArtifactRepositoryRef(BaseModel): - config_map: Optional[str] - key: Optional[str] - -class ArtifactResult(BaseModel): - error: Optional[str] - name: str - success: Optional[bool] - -class ArtifactResultNodeStatus(BaseModel): - artifact_results: Optional[Dict[str, ArtifactResult]] - -class ClusterWorkflowTemplateDeleteResponse(BaseModel): ... - -class CollectEventRequest(BaseModel): - name: Optional[str] - -class CollectEventResponse(BaseModel): ... - -class Condition(BaseModel): - message: Optional[str] - status: Optional[str] - type: Optional[str] - -class ContinueOn(BaseModel): - error: Optional[bool] - failed: Optional[bool] - -class Counter(BaseModel): - value: str - -class CreateS3BucketOptions(BaseModel): - object_locking: Optional[bool] - -class CronWorkflowDeletedResponse(BaseModel): ... - -class CronWorkflowResumeRequest(BaseModel): - name: Optional[str] - namespace: Optional[str] - -class CronWorkflowSuspendRequest(BaseModel): - name: Optional[str] - namespace: Optional[str] - -class Event(BaseModel): - selector: str - -class EventResponse(BaseModel): ... - -class ExecutorConfig(BaseModel): - service_account_name: Optional[str] - -class Gauge(BaseModel): - realtime: bool - value: str - -class GetUserInfoResponse(BaseModel): - email: Optional[str] - email_verified: Optional[bool] - groups: Optional[List[str]] - issuer: Optional[str] - service_account_name: Optional[str] - service_account_namespace: Optional[str] - subject: Optional[str] - -class HTTPBodySource(BaseModel): - bytes: Optional[str] - -class Header(BaseModel): - name: str - value: str - -class Histogram(BaseModel): - buckets: List[Amount] - value: str - -class Item(BaseModel): - __root__: Any - -class LabelKeys(BaseModel): - items: Optional[List[str]] - -class LabelValueFrom(BaseModel): - expression: str - -class LabelValues(BaseModel): - items: Optional[List[str]] - -class Link(BaseModel): - name: str - scope: str - url: str - -class LogEntry(BaseModel): - content: Optional[str] - pod_name: Optional[str] - -class MemoizationStatus(BaseModel): - cache_name: str - hit: bool - key: str - -class Metadata(BaseModel): - annotations: Optional[Dict[str, str]] - labels: Optional[Dict[str, str]] - -class MetricLabel(BaseModel): - key: str - value: str - -class Mutex(BaseModel): - name: Optional[str] - -class MutexHolding(BaseModel): - holder: Optional[str] - mutex: Optional[str] - -class MutexStatus(BaseModel): - holding: Optional[List[MutexHolding]] - waiting: Optional[List[MutexHolding]] - -class NodeSynchronizationStatus(BaseModel): - waiting: Optional[str] - -class NoneStrategy(BaseModel): ... - -class OAuth2EndpointParam(BaseModel): - key: str - value: Optional[str] - -class OSSLifecycleRule(BaseModel): - mark_deletion_after_days: Optional[int] - mark_infrequent_access_after_days: Optional[int] - -class Plugin(BaseModel): ... - -class Prometheus(BaseModel): - counter: Optional[Counter] - gauge: Optional[Gauge] - help: str - histogram: Optional[Histogram] - labels: Optional[List[MetricLabel]] - name: str - when: Optional[str] - -class RawArtifact(BaseModel): - data: str - -class ResubmitArchivedWorkflowRequest(BaseModel): - memoized: Optional[bool] - name: Optional[str] - namespace: Optional[str] - parameters: Optional[List[str]] - uid: Optional[str] - -class RetryArchivedWorkflowRequest(BaseModel): - name: Optional[str] - namespace: Optional[str] - node_field_selector: Optional[str] - parameters: Optional[List[str]] - restart_successful: Optional[bool] - uid: Optional[str] - -class RetryNodeAntiAffinity(BaseModel): ... - -class SemaphoreHolding(BaseModel): - holders: Optional[List[str]] - semaphore: Optional[str] - -class SemaphoreStatus(BaseModel): - holding: Optional[List[SemaphoreHolding]] - waiting: Optional[List[SemaphoreHolding]] - -class SuppliedValueFrom(BaseModel): ... - -class SuspendTemplate(BaseModel): - duration: Optional[str] - -class SynchronizationStatus(BaseModel): - mutex: Optional[MutexStatus] - semaphore: Optional[SemaphoreStatus] - -class TTLStrategy(BaseModel): - seconds_after_completion: Optional[int] - seconds_after_failure: Optional[int] - seconds_after_success: Optional[int] - -class TarStrategy(BaseModel): - compression_level: Optional[int] - -class TemplateRef(BaseModel): - cluster_scope: Optional[bool] - name: Optional[str] - template: Optional[str] - -class TransformationStep(BaseModel): - expression: str - -class Version(BaseModel): - build_date: str - compiler: str - git_commit: str - git_tag: str - git_tree_state: str - go_version: str - platform: str - version: str - -class VolumeClaimGC(BaseModel): - strategy: Optional[str] - -class WorkflowDeleteResponse(BaseModel): ... - -class WorkflowMetadata(BaseModel): - annotations: Optional[Dict[str, str]] - labels: Optional[Dict[str, str]] - labels_from: Optional[Dict[str, LabelValueFrom]] - -class WorkflowResubmitRequest(BaseModel): - memoized: Optional[bool] - name: Optional[str] - namespace: Optional[str] - parameters: Optional[List[str]] - -class WorkflowResumeRequest(BaseModel): - name: Optional[str] - namespace: Optional[str] - node_field_selector: Optional[str] - -class WorkflowRetryRequest(BaseModel): - name: Optional[str] - namespace: Optional[str] - node_field_selector: Optional[str] - parameters: Optional[List[str]] - restart_successful: Optional[bool] - -class WorkflowSetRequest(BaseModel): - message: Optional[str] - name: Optional[str] - namespace: Optional[str] - node_field_selector: Optional[str] - output_parameters: Optional[str] - phase: Optional[str] - -class WorkflowStopRequest(BaseModel): - message: Optional[str] - name: Optional[str] - namespace: Optional[str] - node_field_selector: Optional[str] - -class WorkflowSuspendRequest(BaseModel): - name: Optional[str] - namespace: Optional[str] - -class WorkflowTemplateDeleteResponse(BaseModel): ... - -class WorkflowTemplateRef(BaseModel): - cluster_scope: Optional[bool] - name: Optional[str] - -class WorkflowTerminateRequest(BaseModel): - name: Optional[str] - namespace: Optional[str] - -class ZipStrategy(BaseModel): ... - -class ArchiveStrategy(BaseModel): - none: Optional[NoneStrategy] - tar: Optional[TarStrategy] - zip: Optional[ZipStrategy] - -class ArtifactGC(BaseModel): - pod_metadata: Optional[Metadata] - service_account_name: Optional[str] - strategy: Optional[str] - -class ArtifactGCStatus(BaseModel): - artifact_results_by_node: Optional[Dict[str, ArtifactResultNodeStatus]] - -class ArtifactoryArtifact(BaseModel): - password_secret: Optional[v1.SecretKeySelector] - url: str - username_secret: Optional[v1.SecretKeySelector] - -class ArtifactoryArtifactRepository(BaseModel): - password_secret: Optional[v1.SecretKeySelector] - repo_url: Optional[str] - username_secret: Optional[v1.SecretKeySelector] - -class AzureArtifact(BaseModel): - account_key_secret: Optional[v1.SecretKeySelector] - blob: str - container: str - endpoint: str - use_sdk_creds: Optional[bool] - -class AzureArtifactRepository(BaseModel): - account_key_secret: Optional[v1.SecretKeySelector] - blob_name_format: Optional[str] - container: str - endpoint: str - use_sdk_creds: Optional[bool] - -class Backoff(BaseModel): - duration: Optional[str] - factor: Optional[intstr.IntOrString] - max_duration: Optional[str] - -class BasicAuth(BaseModel): - password_secret: Optional[v1.SecretKeySelector] - username_secret: Optional[v1.SecretKeySelector] - -class Cache(BaseModel): - config_map: v1.ConfigMapKeySelector - -class ClientCertAuth(BaseModel): - client_cert_secret: Optional[v1.SecretKeySelector] - client_key_secret: Optional[v1.SecretKeySelector] - -class ContainerSetRetryStrategy(BaseModel): - duration: Optional[str] - retries: intstr.IntOrString - -class CronWorkflowStatus(BaseModel): - active: Optional[List[v1.ObjectReference]] - conditions: Optional[List[Condition]] - last_scheduled_time: Optional[v1_1.Time] - -class GCSArtifact(BaseModel): - bucket: Optional[str] - key: str - service_account_key_secret: Optional[v1.SecretKeySelector] - -class GCSArtifactRepository(BaseModel): - bucket: Optional[str] - key_format: Optional[str] - service_account_key_secret: Optional[v1.SecretKeySelector] - -class GitArtifact(BaseModel): - branch: Optional[str] - depth: Optional[int] - disable_submodules: Optional[bool] - fetch: Optional[List[str]] - insecure_ignore_host_key: Optional[bool] - password_secret: Optional[v1.SecretKeySelector] - repo: str - revision: Optional[str] - single_branch: Optional[bool] - ssh_private_key_secret: Optional[v1.SecretKeySelector] - username_secret: Optional[v1.SecretKeySelector] - -class HDFSArtifact(BaseModel): - addresses: Optional[List[str]] - force: Optional[bool] - hdfs_user: Optional[str] - krb_c_cache_secret: Optional[v1.SecretKeySelector] - krb_config_config_map: Optional[v1.ConfigMapKeySelector] - krb_keytab_secret: Optional[v1.SecretKeySelector] - krb_realm: Optional[str] - krb_service_principal_name: Optional[str] - krb_username: Optional[str] - path: str - -class HDFSArtifactRepository(BaseModel): - addresses: Optional[List[str]] - force: Optional[bool] - hdfs_user: Optional[str] - krb_c_cache_secret: Optional[v1.SecretKeySelector] - krb_config_config_map: Optional[v1.ConfigMapKeySelector] - krb_keytab_secret: Optional[v1.SecretKeySelector] - krb_realm: Optional[str] - krb_service_principal_name: Optional[str] - krb_username: Optional[str] - path_format: Optional[str] - -class HTTPHeaderSource(BaseModel): - secret_key_ref: Optional[v1.SecretKeySelector] - -class InfoResponse(BaseModel): - links: Optional[List[Link]] - managed_namespace: Optional[str] - modals: Optional[Dict[str, bool]] - nav_color: Optional[str] - -class Memoize(BaseModel): - cache: Cache - key: str - max_age: str - -class Metrics(BaseModel): - prometheus: Optional[List[Prometheus]] - -class OAuth2Auth(BaseModel): - client_id_secret: Optional[v1.SecretKeySelector] - client_secret_secret: Optional[v1.SecretKeySelector] - endpoint_params: Optional[List[OAuth2EndpointParam]] - scopes: Optional[List[str]] - token_url_secret: Optional[v1.SecretKeySelector] - -class OSSArtifact(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] - bucket: Optional[str] - create_bucket_if_not_present: Optional[bool] - endpoint: Optional[str] - key: str - lifecycle_rule: Optional[OSSLifecycleRule] - secret_key_secret: Optional[v1.SecretKeySelector] - security_token: Optional[str] - -class OSSArtifactRepository(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] - bucket: Optional[str] - create_bucket_if_not_present: Optional[bool] - endpoint: Optional[str] - key_format: Optional[str] - lifecycle_rule: Optional[OSSLifecycleRule] - secret_key_secret: Optional[v1.SecretKeySelector] - security_token: Optional[str] - -class RetryAffinity(BaseModel): - node_anti_affinity: Optional[RetryNodeAntiAffinity] - -class RetryStrategy(BaseModel): - affinity: Optional[RetryAffinity] - backoff: Optional[Backoff] - expression: Optional[str] - limit: Optional[intstr.IntOrString] - retry_policy: Optional[str] - -class S3EncryptionOptions(BaseModel): - enable_encryption: Optional[bool] - kms_encryption_context: Optional[str] - kms_key_id: Optional[str] - server_side_customer_key_secret: Optional[v1.SecretKeySelector] - -class SemaphoreRef(BaseModel): - config_map_key_ref: Optional[v1.ConfigMapKeySelector] - -class Sequence(BaseModel): - count: Optional[intstr.IntOrString] - end: Optional[intstr.IntOrString] - format: Optional[str] - start: Optional[intstr.IntOrString] - -class SubmitOpts(BaseModel): - annotations: Optional[str] - dry_run: Optional[bool] - entry_point: Optional[str] - generate_name: Optional[str] - labels: Optional[str] - name: Optional[str] - owner_reference: Optional[v1_1.OwnerReference] - parameters: Optional[List[str]] - pod_priority_class_name: Optional[str] - priority: Optional[int] - server_dry_run: Optional[bool] - service_account: Optional[str] - -class Synchronization(BaseModel): - mutex: Optional[Mutex] - semaphore: Optional[SemaphoreRef] - -class ValueFrom(BaseModel): - config_map_key_ref: Optional[v1.ConfigMapKeySelector] - default: Optional[str] - event: Optional[str] - expression: Optional[str] - jq_filter: Optional[str] - json_path: Optional[str] - parameter: Optional[str] - path: Optional[str] - supplied: Optional[SuppliedValueFrom] - -class WorkflowSubmitRequest(BaseModel): - namespace: Optional[str] - resource_kind: Optional[str] - resource_name: Optional[str] - submit_options: Optional[SubmitOpts] - -class HTTPAuth(BaseModel): - basic_auth: Optional[BasicAuth] - client_cert: Optional[ClientCertAuth] - oauth2: Optional[OAuth2Auth] - -class HTTPHeader(BaseModel): - name: str - value: Optional[str] - value_from: Optional[HTTPHeaderSource] - -class Parameter(BaseModel): - default: Optional[str] - description: Optional[str] - enum: Optional[List[str]] - global_name: Optional[str] - name: str - value: Optional[str] - value_from: Optional[ValueFrom] - -class PodGC(BaseModel): - label_selector: Optional[v1_1.LabelSelector] - strategy: Optional[str] - -class S3Artifact(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] - bucket: Optional[str] - create_bucket_if_not_present: Optional[CreateS3BucketOptions] - encryption_options: Optional[S3EncryptionOptions] - endpoint: Optional[str] - insecure: Optional[bool] - key: Optional[str] - region: Optional[str] - role_arn: Optional[str] - secret_key_secret: Optional[v1.SecretKeySelector] - use_sdk_creds: Optional[bool] - -class S3ArtifactRepository(BaseModel): - access_key_secret: Optional[v1.SecretKeySelector] - bucket: Optional[str] - create_bucket_if_not_present: Optional[CreateS3BucketOptions] - encryption_options: Optional[S3EncryptionOptions] - endpoint: Optional[str] - insecure: Optional[bool] - key_format: Optional[str] - key_prefix: Optional[str] - region: Optional[str] - role_arn: Optional[str] - secret_key_secret: Optional[v1.SecretKeySelector] - use_sdk_creds: Optional[bool] - -class ArtifactRepository(BaseModel): - archive_logs: Optional[bool] - artifactory: Optional[ArtifactoryArtifactRepository] - azure: Optional[AzureArtifactRepository] - gcs: Optional[GCSArtifactRepository] - hdfs: Optional[HDFSArtifactRepository] - oss: Optional[OSSArtifactRepository] - s3: Optional[S3ArtifactRepository] - -class ArtifactRepositoryRefStatus(BaseModel): - artifact_repository: Optional[ArtifactRepository] - config_map: Optional[str] - default: Optional[bool] - key: Optional[str] - namespace: Optional[str] - -class HTTP(BaseModel): - body: Optional[str] - body_from: Optional[HTTPBodySource] - headers: Optional[List[HTTPHeader]] - insecure_skip_verify: Optional[bool] - method: Optional[str] - success_condition: Optional[str] - timeout_seconds: Optional[int] - url: str - -class HTTPArtifact(BaseModel): - auth: Optional[HTTPAuth] - headers: Optional[List[Header]] - url: str - -class Artifact(BaseModel): - archive: Optional[ArchiveStrategy] - archive_logs: Optional[bool] - artifact_gc: Optional[ArtifactGC] - artifactory: Optional[ArtifactoryArtifact] - azure: Optional[AzureArtifact] - deleted: Optional[bool] - from_: Optional[str] - from_expression: Optional[str] - gcs: Optional[GCSArtifact] - git: Optional[GitArtifact] - global_name: Optional[str] - hdfs: Optional[HDFSArtifact] - http: Optional[HTTPArtifact] - mode: Optional[int] - name: str - optional: Optional[bool] - oss: Optional[OSSArtifact] - path: Optional[str] - raw: Optional[RawArtifact] - recurse_mode: Optional[bool] - s3: Optional[S3Artifact] - sub_path: Optional[str] - -class ArtifactLocation(BaseModel): - archive_logs: Optional[bool] - artifactory: Optional[ArtifactoryArtifact] - azure: Optional[AzureArtifact] - gcs: Optional[GCSArtifact] - git: Optional[GitArtifact] - hdfs: Optional[HDFSArtifact] - http: Optional[HTTPArtifact] - oss: Optional[OSSArtifact] - raw: Optional[RawArtifact] - s3: Optional[S3Artifact] - -class ArtifactNodeSpec(BaseModel): - archive_location: Optional[ArtifactLocation] - artifacts: Optional[Dict[str, Artifact]] - -class ArtifactPaths(BaseModel): - archive: Optional[ArchiveStrategy] - archive_logs: Optional[bool] - artifact_gc: Optional[ArtifactGC] - artifactory: Optional[ArtifactoryArtifact] - azure: Optional[AzureArtifact] - deleted: Optional[bool] - from_: Optional[str] - from_expression: Optional[str] - gcs: Optional[GCSArtifact] - git: Optional[GitArtifact] - global_name: Optional[str] - hdfs: Optional[HDFSArtifact] - http: Optional[HTTPArtifact] - mode: Optional[int] - name: str - optional: Optional[bool] - oss: Optional[OSSArtifact] - path: Optional[str] - raw: Optional[RawArtifact] - recurse_mode: Optional[bool] - s3: Optional[S3Artifact] - sub_path: Optional[str] - -class ContainerNode(BaseModel): - args: Optional[List[str]] - command: Optional[List[str]] - dependencies: Optional[List[str]] - env: Optional[List[v1.EnvVar]] - env_from: Optional[List[v1.EnvFromSource]] - image: Optional[str] - image_pull_policy: Optional[str] - lifecycle: Optional[v1.Lifecycle] - liveness_probe: Optional[v1.Probe] - name: str - ports: Optional[List[v1.ContainerPort]] - readiness_probe: Optional[v1.Probe] - resources: Optional[v1.ResourceRequirements] - security_context: Optional[v1.SecurityContext] - startup_probe: Optional[v1.Probe] - stdin: Optional[bool] - stdin_once: Optional[bool] - termination_message_path: Optional[str] - termination_message_policy: Optional[str] - tty: Optional[bool] - volume_devices: Optional[List[v1.VolumeDevice]] - volume_mounts: Optional[List[v1.VolumeMount]] - working_dir: Optional[str] - -class ContainerSetTemplate(BaseModel): - containers: List[ContainerNode] - retry_strategy: Optional[ContainerSetRetryStrategy] - volume_mounts: Optional[List[v1.VolumeMount]] - -class DataSource(BaseModel): - artifact_paths: Optional[ArtifactPaths] - -class Inputs(BaseModel): - artifacts: Optional[List[Artifact]] - parameters: Optional[List[Parameter]] - -class ManifestFrom(BaseModel): - artifact: Artifact - -class Outputs(BaseModel): - artifacts: Optional[List[Artifact]] - exit_code: Optional[str] - parameters: Optional[List[Parameter]] - result: Optional[str] - -class ResourceTemplate(BaseModel): - action: str - failure_condition: Optional[str] - flags: Optional[List[str]] - manifest: Optional[str] - manifest_from: Optional[ManifestFrom] - merge_strategy: Optional[str] - set_owner_reference: Optional[bool] - success_condition: Optional[str] - -class ScriptTemplate(BaseModel): - args: Optional[List[str]] - command: Optional[List[str]] - env: Optional[List[v1.EnvVar]] - env_from: Optional[List[v1.EnvFromSource]] - image: str - image_pull_policy: Optional[str] - lifecycle: Optional[v1.Lifecycle] - liveness_probe: Optional[v1.Probe] - name: Optional[str] - ports: Optional[List[v1.ContainerPort]] - readiness_probe: Optional[v1.Probe] - resources: Optional[v1.ResourceRequirements] - security_context: Optional[v1.SecurityContext] - source: str - startup_probe: Optional[v1.Probe] - stdin: Optional[bool] - stdin_once: Optional[bool] - termination_message_path: Optional[str] - termination_message_policy: Optional[str] - tty: Optional[bool] - volume_devices: Optional[List[v1.VolumeDevice]] - volume_mounts: Optional[List[v1.VolumeMount]] - working_dir: Optional[str] - -class UserContainer(BaseModel): - args: Optional[List[str]] - command: Optional[List[str]] - env: Optional[List[v1.EnvVar]] - env_from: Optional[List[v1.EnvFromSource]] - image: Optional[str] - image_pull_policy: Optional[str] - lifecycle: Optional[v1.Lifecycle] - liveness_probe: Optional[v1.Probe] - mirror_volume_mounts: Optional[bool] - name: str - ports: Optional[List[v1.ContainerPort]] - readiness_probe: Optional[v1.Probe] - resources: Optional[v1.ResourceRequirements] - security_context: Optional[v1.SecurityContext] - startup_probe: Optional[v1.Probe] - stdin: Optional[bool] - stdin_once: Optional[bool] - termination_message_path: Optional[str] - termination_message_policy: Optional[str] - tty: Optional[bool] - volume_devices: Optional[List[v1.VolumeDevice]] - volume_mounts: Optional[List[v1.VolumeMount]] - working_dir: Optional[str] - -class Arguments(BaseModel): - artifacts: Optional[List[Artifact]] - parameters: Optional[List[Parameter]] - -class ArtifactGCSpec(BaseModel): - artifacts_by_node: Optional[Dict[str, ArtifactNodeSpec]] - -class Data(BaseModel): - source: DataSource - transformation: List[TransformationStep] - -class LifecycleHook(BaseModel): - arguments: Optional[Arguments] - expression: Optional[str] - template: Optional[str] - template_ref: Optional[TemplateRef] - -class NodeResult(BaseModel): - message: Optional[str] - outputs: Optional[Outputs] - phase: Optional[str] - progress: Optional[str] - -class NodeStatus(BaseModel): - boundary_id: Optional[str] - children: Optional[List[str]] - daemoned: Optional[bool] - display_name: Optional[str] - estimated_duration: Optional[int] - finished_at: Optional[v1_1.Time] - host_node_name: Optional[str] - id: str - inputs: Optional[Inputs] - memoization_status: Optional[MemoizationStatus] - message: Optional[str] - name: str - outbound_nodes: Optional[List[str]] - outputs: Optional[Outputs] - phase: Optional[str] - pod_ip: Optional[str] - progress: Optional[str] - resources_duration: Optional[Dict[str, int]] - started_at: Optional[v1_1.Time] - synchronization_status: Optional[NodeSynchronizationStatus] - template_name: Optional[str] - template_ref: Optional[TemplateRef] - template_scope: Optional[str] - type: str - -class Submit(BaseModel): - arguments: Optional[Arguments] - metadata: Optional[v1_1.ObjectMeta] - workflow_template_ref: WorkflowTemplateRef - -class WorkflowEventBindingSpec(BaseModel): - event: Event - submit: Optional[Submit] - -class WorkflowTaskSetStatus(BaseModel): - nodes: Optional[Dict[str, NodeResult]] - -class WorkflowEventBinding(BaseModel): - api_version: Optional[str] - kind: Optional[str] - metadata: v1_1.ObjectMeta - spec: WorkflowEventBindingSpec - -class WorkflowEventBindingList(BaseModel): - api_version: Optional[str] - items: Optional[List[WorkflowEventBinding]] - kind: Optional[str] - metadata: v1_1.ListMeta - -class ClusterWorkflowTemplate(BaseModel): - api_version: Optional[str] - kind: Optional[str] - metadata: v1_1.ObjectMeta - spec: WorkflowSpec - -class ClusterWorkflowTemplateCreateRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] - template: Optional[ClusterWorkflowTemplate] - -class ClusterWorkflowTemplateLintRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] - template: Optional[ClusterWorkflowTemplate] - -class ClusterWorkflowTemplateList(BaseModel): - api_version: Optional[str] - items: Optional[List[ClusterWorkflowTemplate]] - kind: Optional[str] - metadata: v1_1.ListMeta - -class ClusterWorkflowTemplateUpdateRequest(BaseModel): - name: Optional[str] - template: Optional[ClusterWorkflowTemplate] - -class CreateCronWorkflowRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] - cron_workflow: Optional[CronWorkflow] - namespace: Optional[str] - -class CronWorkflow(BaseModel): - api_version: Optional[str] - kind: Optional[str] - metadata: v1_1.ObjectMeta - spec: CronWorkflowSpec - status: Optional[CronWorkflowStatus] - -class CronWorkflowList(BaseModel): - api_version: Optional[str] - items: Optional[List[CronWorkflow]] - kind: Optional[str] - metadata: v1_1.ListMeta - -class CronWorkflowSpec(BaseModel): - concurrency_policy: Optional[str] - failed_jobs_history_limit: Optional[int] - schedule: str - starting_deadline_seconds: Optional[int] - successful_jobs_history_limit: Optional[int] - suspend: Optional[bool] - timezone: Optional[str] - workflow_metadata: Optional[v1_1.ObjectMeta] - workflow_spec: WorkflowSpec - -class DAGTask(BaseModel): - arguments: Optional[Arguments] - continue_on: Optional[ContinueOn] - dependencies: Optional[List[str]] - depends: Optional[str] - hooks: Optional[Dict[str, LifecycleHook]] - inline: Optional[Template] - name: str - on_exit: Optional[str] - template: Optional[str] - template_ref: Optional[TemplateRef] - when: Optional[str] - with_items: Optional[List[Item]] - with_param: Optional[str] - with_sequence: Optional[Sequence] - -class DAGTemplate(BaseModel): - fail_fast: Optional[bool] - target: Optional[str] - tasks: List[DAGTask] - -class LintCronWorkflowRequest(BaseModel): - cron_workflow: Optional[CronWorkflow] - namespace: Optional[str] - -class ParallelSteps(BaseModel): - __root__: List[WorkflowStep] - -class Template(BaseModel): - active_deadline_seconds: Optional[intstr.IntOrString] - affinity: Optional[v1.Affinity] - archive_location: Optional[ArtifactLocation] - automount_service_account_token: Optional[bool] - container: Optional[v1.Container] - container_set: Optional[ContainerSetTemplate] - daemon: Optional[bool] - dag: Optional[DAGTemplate] - data: Optional[Data] - executor: Optional[ExecutorConfig] - fail_fast: Optional[bool] - host_aliases: Optional[List[v1.HostAlias]] - http: Optional[HTTP] - init_containers: Optional[List[UserContainer]] - inputs: Optional[Inputs] - memoize: Optional[Memoize] - metadata: Optional[Metadata] - metrics: Optional[Metrics] - name: Optional[str] - node_selector: Optional[Dict[str, str]] - outputs: Optional[Outputs] - parallelism: Optional[int] - plugin: Optional[Plugin] - pod_spec_patch: Optional[str] - priority: Optional[int] - priority_class_name: Optional[str] - resource: Optional[ResourceTemplate] - retry_strategy: Optional[RetryStrategy] - scheduler_name: Optional[str] - script: Optional[ScriptTemplate] - security_context: Optional[v1.PodSecurityContext] - service_account_name: Optional[str] - sidecars: Optional[List[UserContainer]] - steps: Optional[List[ParallelSteps]] - suspend: Optional[SuspendTemplate] - synchronization: Optional[Synchronization] - timeout: Optional[str] - tolerations: Optional[List[v1.Toleration]] - volumes: Optional[List[v1.Volume]] - -class UpdateCronWorkflowRequest(BaseModel): - cron_workflow: Optional[CronWorkflow] - name: Optional[str] - namespace: Optional[str] - -class Workflow(BaseModel): - api_version: Optional[str] - kind: Optional[str] - metadata: v1_1.ObjectMeta - spec: WorkflowSpec - status: Optional[WorkflowStatus] - -class WorkflowCreateRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] - instance_id: Optional[str] - namespace: Optional[str] - server_dry_run: Optional[bool] - workflow: Optional[Workflow] - -class WorkflowLintRequest(BaseModel): - namespace: Optional[str] - workflow: Optional[Workflow] - -class WorkflowList(BaseModel): - api_version: Optional[str] - items: Optional[List[Workflow]] - kind: Optional[str] - metadata: v1_1.ListMeta - -class WorkflowSpec(BaseModel): - active_deadline_seconds: Optional[int] - affinity: Optional[v1.Affinity] - archive_logs: Optional[bool] - arguments: Optional[Arguments] - artifact_gc: Optional[ArtifactGC] - artifact_repository_ref: Optional[ArtifactRepositoryRef] - automount_service_account_token: Optional[bool] - dns_config: Optional[v1.PodDNSConfig] - dns_policy: Optional[str] - entrypoint: Optional[str] - executor: Optional[ExecutorConfig] - hooks: Optional[Dict[str, LifecycleHook]] - host_aliases: Optional[List[v1.HostAlias]] - host_network: Optional[bool] - image_pull_secrets: Optional[List[v1.LocalObjectReference]] - metrics: Optional[Metrics] - node_selector: Optional[Dict[str, str]] - on_exit: Optional[str] - parallelism: Optional[int] - pod_disruption_budget: Optional[v1beta1.PodDisruptionBudgetSpec] - pod_gc: Optional[PodGC] - pod_metadata: Optional[Metadata] - pod_priority: Optional[int] - pod_priority_class_name: Optional[str] - pod_spec_patch: Optional[str] - priority: Optional[int] - retry_strategy: Optional[RetryStrategy] - scheduler_name: Optional[str] - security_context: Optional[v1.PodSecurityContext] - service_account_name: Optional[str] - shutdown: Optional[str] - suspend: Optional[bool] - synchronization: Optional[Synchronization] - template_defaults: Optional[Template] - templates: Optional[List[Template]] - tolerations: Optional[List[v1.Toleration]] - ttl_strategy: Optional[TTLStrategy] - volume_claim_gc: Optional[VolumeClaimGC] - volume_claim_templates: Optional[List[v1.PersistentVolumeClaim]] - volumes: Optional[List[v1.Volume]] - workflow_metadata: Optional[WorkflowMetadata] - workflow_template_ref: Optional[WorkflowTemplateRef] - -class WorkflowStatus(BaseModel): - artifact_gc_status: Optional[ArtGCStatus] - artifact_repository_ref: Optional[ArtifactRepositoryRefStatus] - compressed_nodes: Optional[str] - conditions: Optional[List[Condition]] - estimated_duration: Optional[int] - finished_at: Optional[v1_1.Time] - message: Optional[str] - nodes: Optional[Dict[str, NodeStatus]] - offload_node_status_version: Optional[str] - outputs: Optional[Outputs] - persistent_volume_claims: Optional[List[v1.Volume]] - phase: Optional[str] - progress: Optional[str] - resources_duration: Optional[Dict[str, int]] - started_at: Optional[v1_1.Time] - stored_templates: Optional[Dict[str, Template]] - stored_workflow_template_spec: Optional[WorkflowSpec] - synchronization: Optional[SynchronizationStatus] - -class WorkflowStep(BaseModel): - arguments: Optional[Arguments] - continue_on: Optional[ContinueOn] - hooks: Optional[Dict[str, LifecycleHook]] - inline: Optional[Template] - name: Optional[str] - on_exit: Optional[str] - template: Optional[str] - template_ref: Optional[TemplateRef] - when: Optional[str] - with_items: Optional[List[Item]] - with_param: Optional[str] - with_sequence: Optional[Sequence] - -class WorkflowTaskSetSpec(BaseModel): - tasks: Optional[Dict[str, Template]] - -class WorkflowTemplate(BaseModel): - api_version: Optional[str] - kind: Optional[str] - metadata: v1_1.ObjectMeta - spec: WorkflowSpec - -class WorkflowTemplateCreateRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] - namespace: Optional[str] - template: Optional[WorkflowTemplate] - -class WorkflowTemplateLintRequest(BaseModel): - create_options: Optional[v1_1.CreateOptions] - namespace: Optional[str] - template: Optional[WorkflowTemplate] - -class WorkflowTemplateList(BaseModel): - api_version: Optional[str] - items: Optional[List[WorkflowTemplate]] - kind: Optional[str] - metadata: v1_1.ListMeta - -class WorkflowTemplateUpdateRequest(BaseModel): - name: Optional[str] - namespace: Optional[str] - template: Optional[WorkflowTemplate] - -class WorkflowWatchEvent(BaseModel): - object: Optional[Workflow] - type: Optional[str] diff --git a/src/hera/workflows/models/io/k8s/api/core/v1.py b/src/hera/workflows/models/io/k8s/api/core/v1.py index 1d1b69b6f..bf300e635 100644 --- a/src/hera/workflows/models/io/k8s/api/core/v1.py +++ b/src/hera/workflows/models/io/k8s/api/core/v1.py @@ -6,6 +6,8 @@ from enum import Enum from typing import Dict, List, Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from ...apimachinery.pkg.api import resource @@ -13,135 +15,195 @@ from ...apimachinery.pkg.util import intstr +class SecretKeySelector(BaseModel): + key: Annotated[ + str, + Field(description=("The key of the secret to select from. Must be a valid secret key.")), + ] + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the Secret or its key must be defined"), + ] = None + + +class ConfigMapKeySelector(BaseModel): + key: Annotated[str, Field(description="The key to select.")] + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the ConfigMap or its key must be defined"), + ] = None + + class AWSElasticBlockStoreVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type of the volume that you want to mount. Tip: Ensure that the" - " filesystem type is supported by the host operating system. Examples:" - ' "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' - " More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - ), - ) - partition: Optional[int] = Field( - default=None, - description=( - "The partition in the volume that you want to mount. If omitted, the" - " default is to mount by volume name. Examples: For volume /dev/sda1, you" - ' specify the partition as "1". Similarly, the volume partition for' - ' /dev/sda is "0" (or you can leave the property empty).' - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - 'Specify "true" to force and set the ReadOnly property in VolumeMounts to' - ' "true". If omitted, the default is "false". More info:' - " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - ), - ) - volume_id: str = Field( - ..., - alias="volumeID", - description=( - "Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More" - " info:" - " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - ), - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type of the volume that you want to mount. Tip: Ensure that" + " the filesystem type is supported by the host operating system." + ' Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if' + " unspecified. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + ), + ), + ] = None + partition: Annotated[ + Optional[int], + Field( + description=( + "The partition in the volume that you want to mount. If omitted, the" + " default is to mount by volume name. Examples: For volume /dev/sda1," + ' you specify the partition as "1". Similarly, the volume partition for' + ' /dev/sda is "0" (or you can leave the property empty).' + ) + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + 'Specify "true" to force and set the ReadOnly property in VolumeMounts' + ' to "true". If omitted, the default is "false". More info:' + " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + ), + ), + ] = None + volume_id: Annotated[ + str, + Field( + alias="volumeID", + description=( + "Unique ID of the persistent disk resource in AWS (Amazon EBS volume)." + " More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + ), + ), + ] class AzureDiskVolumeSource(BaseModel): - caching_mode: Optional[str] = Field( - default=None, - alias="cachingMode", - description="Host Caching mode: None, Read Only, Read Write.", - ) - disk_name: str = Field( - ..., - alias="diskName", - description="The Name of the data disk in the blob storage", - ) - disk_uri: str = Field(..., alias="diskURI", description="The URI the data disk in the blob storage") - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Expected values Shared: multiple blob disks per storage account " - " Dedicated: single blob disk per storage account Managed: azure managed" - " data disk (only in managed availability set). defaults to shared" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." - ), - ) + caching_mode: Annotated[ + Optional[str], + Field( + alias="cachingMode", + description="Host Caching mode: None, Read Only, Read Write.", + ), + ] = None + disk_name: Annotated[ + str, + Field( + alias="diskName", + description="The Name of the data disk in the blob storage", + ), + ] + disk_uri: Annotated[ + str, + Field(alias="diskURI", description="The URI the data disk in the blob storage"), + ] + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Expected values Shared: multiple blob disks per storage account " + " Dedicated: single blob disk per storage account Managed: azure" + " managed data disk (only in managed availability set). defaults to" + " shared" + ) + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), + ), + ] = None class AzureFileVolumeSource(BaseModel): - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), ), - ) - secret_name: str = Field( - ..., - alias="secretName", - description=("the name of secret that contains Azure Storage Account Name and Key"), - ) - share_name: str = Field(..., alias="shareName", description="Share Name") - - -class Capabilities(BaseModel): - add: Optional[List[str]] = Field(default=None, description="Added capabilities") - drop: Optional[List[str]] = Field(default=None, description="Removed capabilities") + ] = None + secret_name: Annotated[ + str, + Field( + alias="secretName", + description=("the name of secret that contains Azure Storage Account Name and Key"), + ), + ] + share_name: Annotated[str, Field(alias="shareName", description="Share Name")] -class ConfigMapEnvSource(BaseModel): - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" +class LocalObjectReference(BaseModel): + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) ), - ) - optional: Optional[bool] = Field(default=None, description="Specify whether the ConfigMap must be defined") + ] = None -class ConfigMapKeySelector(BaseModel): - key: str = Field(..., description="The key to select.") - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the ConfigMap or its key must be defined", - ) +class Capabilities(BaseModel): + add: Annotated[Optional[List[str]], Field(description="Added capabilities")] = None + drop: Annotated[Optional[List[str]], Field(description="Removed capabilities")] = None -class TerminationMessagePolicy(Enum): - fallback_to_logs_on_error = "FallbackToLogsOnError" - file = "File" +class ConfigMapEnvSource(BaseModel): + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the ConfigMap must be defined"), + ] = None class Protocol(Enum): @@ -151,210 +213,348 @@ class Protocol(Enum): class ContainerPort(BaseModel): - container_port: int = Field( - ..., - alias="containerPort", - description=( - "Number of port to expose on the pod's IP address. This must be a valid" " port number, 0 < x < 65536." - ), - ) - host_ip: Optional[str] = Field( - default=None, - alias="hostIP", - description="What host IP to bind the external port to.", - ) - host_port: Optional[int] = Field( - default=None, - alias="hostPort", - description=( - "Number of port to expose on the host. If specified, this must be a valid" - " port number, 0 < x < 65536. If HostNetwork is specified, this must match" - " ContainerPort. Most containers do not need this." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "If specified, this must be an IANA_SVC_NAME and unique within the pod." - " Each named port in a pod must have a unique name. Name for the port that" - " can be referred to by services." - ), - ) - protocol: Optional[Protocol] = Field( - default=None, - description=( - "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to" - ' "TCP".\n\nPossible enum values:\n - `"SCTP"` is the SCTP protocol.\n -' - ' `"TCP"` is the TCP protocol.\n - `"UDP"` is the UDP protocol.' - ), - ) + container_port: Annotated[ + int, + Field( + alias="containerPort", + description=( + "Number of port to expose on the pod's IP address. This must be a valid" " port number, 0 < x < 65536." + ), + ), + ] + host_ip: Annotated[ + Optional[str], + Field(alias="hostIP", description="What host IP to bind the external port to."), + ] = None + host_port: Annotated[ + Optional[int], + Field( + alias="hostPort", + description=( + "Number of port to expose on the host. If specified, this must be a" + " valid port number, 0 < x < 65536. If HostNetwork is specified, this" + " must match ContainerPort. Most containers do not need this." + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "If specified, this must be an IANA_SVC_NAME and unique within the pod." + " Each named port in a pod must have a unique name. Name for the port" + " that can be referred to by services." + ) + ), + ] = None + protocol: Annotated[ + Optional[Protocol], + Field( + description=( + "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to" + ' "TCP".\n\nPossible enum values:\n - `"SCTP"` is the SCTP protocol.\n' + ' - `"TCP"` is the TCP protocol.\n - `"UDP"` is the UDP protocol.' + ) + ), + ] = None + + +class ObjectFieldSelector(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=("Version of the schema the FieldPath is written in terms of, defaults" ' to "v1".'), + ), + ] = None + field_path: Annotated[ + str, + Field( + alias="fieldPath", + description="Path of the field to select in the specified API version.", + ), + ] + + +class SecretEnvSource(BaseModel): + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[Optional[bool], Field(description="Specify whether the Secret must be defined")] = None + + +class ObjectReference(BaseModel): + api_version: Annotated[ + Optional[str], + Field(alias="apiVersion", description="API version of the referent."), + ] = None + field_path: Annotated[ + Optional[str], + Field( + alias="fieldPath", + description=( + "If referring to a piece of an object instead of an entire object, this" + " string should contain a valid JSON/Go field access statement, such as" + " desiredState.manifest.containers[2]. For example, if the object" + " reference is to a container within a pod, this would take on a value" + ' like: "spec.containers{name}" (where "name" refers to the name of the' + " container that triggered the event) or if no container name is" + ' specified "spec.containers[2]" (container with index 2 in this pod).' + " This syntax is chosen only to have some well-defined way of" + " referencing a part of an object." + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind of the referent. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + namespace: Annotated[ + Optional[str], + Field( + description=( + "Namespace of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" + ) + ), + ] = None + resource_version: Annotated[ + Optional[str], + Field( + alias="resourceVersion", + description=( + "Specific resourceVersion to which this reference is made, if any. More" + " info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" + ), + ), + ] = None + uid: Annotated[ + Optional[str], + Field( + description=( + "UID of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids" + ) + ), + ] = None class EventSource(BaseModel): - component: Optional[str] = Field(default=None, description="Component from which the event is generated.") - host: Optional[str] = Field(default=None, description="Node name on which the event is generated.") + component: Annotated[Optional[str], Field(description="Component from which the event is generated.")] = None + host: Annotated[Optional[str], Field(description="Node name on which the event is generated.")] = None class ExecAction(BaseModel): - command: Optional[List[str]] = Field( - default=None, - description=( - "Command is the command line to execute inside the container, the working" - " directory for the command is root ('/') in the container's filesystem." - " The command is simply exec'd, it is not run inside a shell, so" - " traditional shell instructions ('|', etc) won't work. To use a shell, you" - " need to explicitly call out to that shell. Exit status of 0 is treated as" - " live/healthy and non-zero is unhealthy." + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Command is the command line to execute inside the container, the" + " working directory for the command is root ('/') in the container's" + " filesystem. The command is simply exec'd, it is not run inside a" + " shell, so traditional shell instructions ('|', etc) won't work. To" + " use a shell, you need to explicitly call out to that shell. Exit" + " status of 0 is treated as live/healthy and non-zero is unhealthy." + ) ), - ) + ] = None class FCVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - lun: Optional[int] = Field(default=None, description="Optional: FC target lun number") - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Optional: Defaults to false (read/write). ReadOnly here will force the" - " ReadOnly setting in VolumeMounts." - ), - ) - target_ww_ns: Optional[List[str]] = Field( - default=None, - alias="targetWWNs", - description="Optional: FC target worldwide names (WWNs)", - ) - wwids: Optional[List[str]] = Field( - default=None, - description=( - "Optional: FC volume world wide identifiers (wwids) Either wwids or" - " combination of targetWWNs and lun must be set, but not both" - " simultaneously." - ), - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + lun: Annotated[Optional[int], Field(description="Optional: FC target lun number")] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Optional: Defaults to false (read/write). ReadOnly here will force the" + " ReadOnly setting in VolumeMounts." + ), + ), + ] = None + target_ww_ns: Annotated[ + Optional[List[str]], + Field(alias="targetWWNs", description="Optional: FC target worldwide names (WWNs)"), + ] = None + wwids: Annotated[ + Optional[List[str]], + Field( + description=( + "Optional: FC volume world wide identifiers (wwids) Either wwids or" + " combination of targetWWNs and lun must be set, but not both" + " simultaneously." + ) + ), + ] = None class FlockerVolumeSource(BaseModel): - dataset_name: Optional[str] = Field( - default=None, - alias="datasetName", - description=( - "Name of the dataset stored as metadata -> name on the dataset for Flocker" - " should be considered as deprecated" + dataset_name: Annotated[ + Optional[str], + Field( + alias="datasetName", + description=( + "Name of the dataset stored as metadata -> name on the dataset for" + " Flocker should be considered as deprecated" + ), + ), + ] = None + dataset_uuid: Annotated[ + Optional[str], + Field( + alias="datasetUUID", + description=("UUID of the dataset. This is unique identifier of a Flocker dataset"), ), - ) - dataset_uuid: Optional[str] = Field( - default=None, - alias="datasetUUID", - description=("UUID of the dataset. This is unique identifier of a Flocker dataset"), - ) + ] = None class GCEPersistentDiskVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type of the volume that you want to mount. Tip: Ensure that the" - " filesystem type is supported by the host operating system. Examples:" - ' "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' - " More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) - partition: Optional[int] = Field( - default=None, - description=( - "The partition in the volume that you want to mount. If omitted, the" - " default is to mount by volume name. Examples: For volume /dev/sda1, you" - ' specify the partition as "1". Similarly, the volume partition for' - ' /dev/sda is "0" (or you can leave the property empty). More info:' - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) - pd_name: str = Field( - ..., - alias="pdName", - description=( - "Unique name of the PD resource in GCE. Used to identify the disk in GCE." - " More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to" - " false. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type of the volume that you want to mount. Tip: Ensure that" + " the filesystem type is supported by the host operating system." + ' Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if' + " unspecified. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ), + ), + ] = None + partition: Annotated[ + Optional[int], + Field( + description=( + "The partition in the volume that you want to mount. If omitted, the" + " default is to mount by volume name. Examples: For volume /dev/sda1," + ' you specify the partition as "1". Similarly, the volume partition for' + ' /dev/sda is "0" (or you can leave the property empty). More info:' + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ) + ), + ] = None + pd_name: Annotated[ + str, + Field( + alias="pdName", + description=( + "Unique name of the PD resource in GCE. Used to identify the disk in" + " GCE. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ), + ), + ] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the ReadOnly setting in VolumeMounts." + " Defaults to false. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ), + ), + ] = None class GRPCAction(BaseModel): - port: int = Field( - ..., - description=("Port number of the gRPC service. Number must be in the range 1 to 65535."), - ) - service: Optional[str] = Field( - default=None, - description=( - "Service is the name of the service to place in the gRPC HealthCheckRequest" - " (see" - " https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf" - " this is not specified, the default behavior is defined by gRPC." - ), - ) + port: Annotated[ + int, + Field(description=("Port number of the gRPC service. Number must be in the range 1 to" " 65535.")), + ] + service: Annotated[ + Optional[str], + Field( + description=( + "Service is the name of the service to place in the gRPC" + " HealthCheckRequest (see" + " https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\nIf" + " this is not specified, the default behavior is defined by gRPC." + ) + ), + ] = None class GitRepoVolumeSource(BaseModel): - directory: Optional[str] = Field( - default=None, - description=( - "Target directory name. Must not contain or start with '..'. If '.' is" - " supplied, the volume directory will be the git repository. Otherwise, if" - " specified, the volume will contain the git repository in the subdirectory" - " with the given name." + directory: Annotated[ + Optional[str], + Field( + description=( + "Target directory name. Must not contain or start with '..'. If '.' is" + " supplied, the volume directory will be the git repository. " + " Otherwise, if specified, the volume will contain the git repository" + " in the subdirectory with the given name." + ) ), - ) - repository: str = Field(..., description="Repository URL") - revision: Optional[str] = Field(default=None, description="Commit hash for the specified revision.") + ] = None + repository: Annotated[str, Field(description="Repository URL")] + revision: Annotated[Optional[str], Field(description="Commit hash for the specified revision.")] = None class GlusterfsVolumeSource(BaseModel): - endpoints: str = Field( - ..., - description=( - "EndpointsName is the endpoint name that details Glusterfs topology. More" - " info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" - ), - ) - path: str = Field( - ..., - description=( - "Path is the Glusterfs volume path. More info:" - " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the Glusterfs volume to be mounted with read-only" - " permissions. Defaults to false. More info:" - " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" - ), - ) + endpoints: Annotated[ + str, + Field( + description=( + "EndpointsName is the endpoint name that details Glusterfs topology." + " More info:" + " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" + ) + ), + ] + path: Annotated[ + str, + Field( + description=( + "Path is the Glusterfs volume path. More info:" + " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" + ) + ), + ] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the Glusterfs volume to be mounted with" + " read-only permissions. Defaults to false. More info:" + " https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod" + ), + ), + ] = None class Scheme(Enum): @@ -363,90 +563,95 @@ class Scheme(Enum): class HTTPHeader(BaseModel): - name: str = Field(..., description="The header field name") - value: str = Field(..., description="The header field value") + name: Annotated[str, Field(description="The header field name")] + value: Annotated[str, Field(description="The header field value")] class HostAlias(BaseModel): - hostnames: Optional[List[str]] = Field(default=None, description="Hostnames for the above IP address.") - ip: Optional[str] = Field(default=None, description="IP address of the host file entry.") + hostnames: Annotated[Optional[List[str]], Field(description="Hostnames for the above IP address.")] = None + ip: Annotated[Optional[str], Field(description="IP address of the host file entry.")] = None class HostPathVolumeSource(BaseModel): - path: str = Field( - ..., - description=( - "Path of the directory on the host. If the path is a symlink, it will" - " follow the link to the real path. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" - ), - ) - type: Optional[str] = Field( - default=None, - description=( - 'Type for HostPath Volume Defaults to "" More info:' - " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" - ), - ) + path: Annotated[ + str, + Field( + description=( + "Path of the directory on the host. If the path is a symlink, it will" + " follow the link to the real path. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" + ) + ), + ] + type: Annotated[ + Optional[str], + Field( + description=( + 'Type for HostPath Volume Defaults to "" More info:' + " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" + ) + ), + ] = None class KeyToPath(BaseModel): - key: str = Field(..., description="The key to project.") - mode: Optional[int] = Field( - default=None, - description=( - "Optional: mode bits used to set permissions on this file. Must be an octal" - " value between 0000 and 0777 or a decimal value between 0 and 511. YAML" - " accepts both octal and decimal values, JSON requires decimal values for" - " mode bits. If not specified, the volume defaultMode will be used. This" - " might be in conflict with other options that affect the file mode, like" - " fsGroup, and the result can be other mode bits set." - ), - ) - path: str = Field( - ..., - description=( - "The relative path of the file to map the key to. May not be an absolute" - " path. May not contain the path element '..'. May not start with the" - " string '..'." - ), - ) - - -class LocalObjectReference(BaseModel): - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) + key: Annotated[str, Field(description="The key to project.")] + mode: Annotated[ + Optional[int], + Field( + description=( + "Optional: mode bits used to set permissions on this file. Must be an" + " octal value between 0000 and 0777 or a decimal value between 0 and" + " 511. YAML accepts both octal and decimal values, JSON requires" + " decimal values for mode bits. If not specified, the volume" + " defaultMode will be used. This might be in conflict with other" + " options that affect the file mode, like fsGroup, and the result can" + " be other mode bits set." + ) + ), + ] = None + path: Annotated[ + str, + Field( + description=( + "The relative path of the file to map the key to. May not be an" + " absolute path. May not contain the path element '..'. May not start" + " with the string '..'." + ) + ), + ] class NFSVolumeSource(BaseModel): - path: str = Field( - ..., - description=( - "Path that is exported by the NFS server. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#nfs" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the NFS export to be mounted with read-only" - " permissions. Defaults to false. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#nfs" - ), - ) - server: str = Field( - ..., - description=( - "Server is the hostname or IP address of the NFS server. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#nfs" - ), - ) + path: Annotated[ + str, + Field( + description=( + "Path that is exported by the NFS server. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#nfs" + ) + ), + ] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the NFS export to be mounted with read-only" + " permissions. Defaults to false. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#nfs" + ), + ), + ] = None + server: Annotated[ + str, + Field( + description=( + "Server is the hostname or IP address of the NFS server. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#nfs" + ) + ), + ] class Operator(Enum): @@ -459,113 +664,47 @@ class Operator(Enum): class NodeSelectorRequirement(BaseModel): - key: str = Field(..., description="The label key that the selector applies to.") - operator: Operator = Field( - ..., - description=( - "Represents a key's relationship to a set of values. Valid operators are" - " In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\nPossible enum values:\n -" - ' `"DoesNotExist"`\n - `"Exists"`\n - `"Gt"`\n - `"In"`\n - `"Lt"`\n -' - ' `"NotIn"`' - ), - ) - values: Optional[List[str]] = Field( - default=None, - description=( - "An array of string values. If the operator is In or NotIn, the values" - " array must be non-empty. If the operator is Exists or DoesNotExist, the" - " values array must be empty. If the operator is Gt or Lt, the values array" - " must have a single element, which will be interpreted as an integer. This" - " array is replaced during a strategic merge patch." - ), - ) + key: Annotated[str, Field(description="The label key that the selector applies to.")] + operator: Annotated[ + Operator, + Field( + description=( + "Represents a key's relationship to a set of values. Valid operators" + " are In, NotIn, Exists, DoesNotExist. Gt, and Lt.\n\nPossible enum" + ' values:\n - `"DoesNotExist"`\n - `"Exists"`\n - `"Gt"`\n - `"In"`\n -' + ' `"Lt"`\n - `"NotIn"`' + ) + ), + ] + values: Annotated[ + Optional[List[str]], + Field( + description=( + "An array of string values. If the operator is In or NotIn, the values" + " array must be non-empty. If the operator is Exists or DoesNotExist," + " the values array must be empty. If the operator is Gt or Lt, the" + " values array must have a single element, which will be interpreted as" + " an integer. This array is replaced during a strategic merge patch." + ) + ), + ] = None class NodeSelectorTerm(BaseModel): - match_expressions: Optional[List[NodeSelectorRequirement]] = Field( - default=None, - alias="matchExpressions", - description="A list of node selector requirements by node's labels.", - ) - match_fields: Optional[List[NodeSelectorRequirement]] = Field( - default=None, - alias="matchFields", - description="A list of node selector requirements by node's fields.", - ) - - -class ObjectFieldSelector(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=("Version of the schema the FieldPath is written in terms of, defaults to" ' "v1".'), - ) - field_path: str = Field( - ..., - alias="fieldPath", - description="Path of the field to select in the specified API version.", - ) - - -class ObjectReference(BaseModel): - api_version: Optional[str] = Field(default=None, alias="apiVersion", description="API version of the referent.") - field_path: Optional[str] = Field( - default=None, - alias="fieldPath", - description=( - "If referring to a piece of an object instead of an entire object, this" - " string should contain a valid JSON/Go field access statement, such as" - " desiredState.manifest.containers[2]. For example, if the object reference" - " is to a container within a pod, this would take on a value like:" - ' "spec.containers{name}" (where "name" refers to the name of the container' - " that triggered the event) or if no container name is specified" - ' "spec.containers[2]" (container with index 2 in this pod). This syntax is' - " chosen only to have some well-defined way of referencing a part of an" - " object." - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind of the referent. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - namespace: Optional[str] = Field( - default=None, - description=( - "Namespace of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/" - ), - ) - resource_version: Optional[str] = Field( - default=None, - alias="resourceVersion", - description=( - "Specific resourceVersion to which this reference is made, if any. More" - " info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" - ), - ) - uid: Optional[str] = Field( - default=None, - description=( - "UID of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids" - ), - ) - - -class Type(Enum): - file_system_resize_pending = "FileSystemResizePending" - resizing = "Resizing" + match_expressions: Annotated[ + Optional[List[NodeSelectorRequirement]], + Field( + alias="matchExpressions", + description="A list of node selector requirements by node's labels.", + ), + ] = None + match_fields: Annotated[ + Optional[List[NodeSelectorRequirement]], + Field( + alias="matchFields", + description="A list of node selector requirements by node's fields.", + ), + ] = None class Phase(Enum): @@ -574,463 +713,366 @@ class Phase(Enum): pending = "Pending" +class TypedLocalObjectReference(BaseModel): + api_group: Annotated[ + Optional[str], + Field( + alias="apiGroup", + description=( + "APIGroup is the group for the resource being referenced. If APIGroup" + " is not specified, the specified Kind must be in the core API group." + " For any other third-party types, APIGroup is required." + ), + ), + ] = None + kind: Annotated[str, Field(description="Kind is the type of resource being referenced")] + name: Annotated[str, Field(description="Name is the name of resource being referenced")] + + class PersistentVolumeClaimVolumeSource(BaseModel): - claim_name: str = Field( - ..., - alias="claimName", - description=( - "ClaimName is the name of a PersistentVolumeClaim in the same namespace as" - " the pod using this volume. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description="Will force the ReadOnly setting in VolumeMounts. Default false.", - ) + claim_name: Annotated[ + str, + Field( + alias="claimName", + description=( + "ClaimName is the name of a PersistentVolumeClaim in the same namespace" + " as the pod using this volume. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" + ), + ), + ] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=("Will force the ReadOnly setting in VolumeMounts. Default false."), + ), + ] = None class PhotonPersistentDiskVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - pd_id: str = Field( - ..., - alias="pdID", - description="ID that identifies Photon Controller persistent disk", - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + pd_id: Annotated[ + str, + Field( + alias="pdID", + description="ID that identifies Photon Controller persistent disk", + ), + ] class PodDNSConfigOption(BaseModel): - name: Optional[str] = Field(default=None, description="Required.") + name: Annotated[Optional[str], Field(description="Required.")] = None value: Optional[str] = None -class PortworxVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "FSType represents the filesystem type to mount Must be a filesystem type" - ' supported by the host operating system. Ex. "ext4", "xfs". Implicitly' - ' inferred to be "ext4" if unspecified.' - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." - ), - ) - volume_id: str = Field( - ..., - alias="volumeID", - description="VolumeID uniquely identifies a Portworx volume", - ) - - -class PreferredSchedulingTerm(BaseModel): - preference: NodeSelectorTerm = Field( - ..., - description="A node selector term, associated with the corresponding weight.", - ) - weight: int = Field( - ..., - description=("Weight associated with matching the corresponding nodeSelectorTerm, in the" " range 1-100."), - ) - - -class QuobyteVolumeSource(BaseModel): - group: Optional[str] = Field(default=None, description="Group to map volume access to Default is no group") - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the Quobyte volume to be mounted with read-only" - " permissions. Defaults to false." - ), - ) - registry: str = Field( - ..., - description=( - "Registry represents a single or multiple Quobyte Registry services" - " specified as a string as host:port pair (multiple entries are separated" - " with commas) which acts as the central registry for volumes" - ), - ) - tenant: Optional[str] = Field( - default=None, - description=( - "Tenant owning the given Quobyte volume in the Backend Used with" - " dynamically provisioned Quobyte volumes, value is set by the plugin" - ), - ) - user: Optional[str] = Field( - default=None, - description="User to map volume access to Defaults to serivceaccount user", - ) - volume: str = Field( - ..., - description=("Volume is a string that references an already created Quobyte volume by" " name."), - ) - - -class RBDVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type of the volume that you want to mount. Tip: Ensure that the" - " filesystem type is supported by the host operating system. Examples:" - ' "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' - " More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd" - ), - ) - image: str = Field( - ..., - description=( - "The rados image name. More info:" " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - keyring: Optional[str] = Field( - default=None, - description=( - "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring." - " More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - monitors: List[str] = Field( - ..., - description=( - "A collection of Ceph monitors. More info:" " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - pool: Optional[str] = Field( - default=None, - description=( - "The rados pool name. Default is rbd. More info:" - " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to" - " false. More info:" - " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=( - "SecretRef is name of the authentication secret for RBDUser. If provided" - " overrides keyring. Default is nil. More info:" - " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - user: Optional[str] = Field( - default=None, - description=( - "The rados user name. Default is admin. More info:" - " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" - ), - ) - - class SELinuxOptions(BaseModel): - level: Optional[str] = Field( - default=None, - description="Level is SELinux level label that applies to the container.", - ) - role: Optional[str] = Field( - default=None, - description="Role is a SELinux role label that applies to the container.", - ) - type: Optional[str] = Field( - default=None, - description="Type is a SELinux type label that applies to the container.", - ) - user: Optional[str] = Field( - default=None, - description="User is a SELinux user label that applies to the container.", - ) - - -class ScaleIOVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs".' - ), - ) - gateway: str = Field(..., description="The host address of the ScaleIO API Gateway.") - protection_domain: Optional[str] = Field( - default=None, - alias="protectionDomain", - description=("The name of the ScaleIO Protection Domain for the configured storage."), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." - ), - ) - secret_ref: LocalObjectReference = Field( - ..., - alias="secretRef", - description=( - "SecretRef references to the secret for ScaleIO user and other sensitive" - " information. If this is not provided, Login operation will fail." - ), - ) - ssl_enabled: Optional[bool] = Field( - default=None, - alias="sslEnabled", - description=("Flag to enable/disable SSL communication with Gateway, default false"), - ) - storage_mode: Optional[str] = Field( - default=None, - alias="storageMode", - description=( - "Indicates whether the storage for a volume should be ThickProvisioned or" - " ThinProvisioned. Default is ThinProvisioned." - ), - ) - storage_pool: Optional[str] = Field( - default=None, - alias="storagePool", - description="The ScaleIO Storage Pool associated with the protection domain.", - ) - system: str = Field(..., description="The name of the storage system as configured in ScaleIO.") - volume_name: Optional[str] = Field( - default=None, - alias="volumeName", - description=( - "The name of a volume already created in the ScaleIO system that is" " associated with this volume source." - ), - ) + level: Annotated[ + Optional[str], + Field(description="Level is SELinux level label that applies to the container."), + ] = None + role: Annotated[ + Optional[str], + Field(description="Role is a SELinux role label that applies to the container."), + ] = None + type: Annotated[ + Optional[str], + Field(description="Type is a SELinux type label that applies to the container."), + ] = None + user: Annotated[ + Optional[str], + Field(description="User is a SELinux user label that applies to the container."), + ] = None -class TypeModel(Enum): +class Type(Enum): localhost = "Localhost" runtime_default = "RuntimeDefault" unconfined = "Unconfined" class SeccompProfile(BaseModel): - localhost_profile: Optional[str] = Field( - default=None, - alias="localhostProfile", - description=( - "localhostProfile indicates a profile defined in a file on the node should" - " be used. The profile must be preconfigured on the node to work. Must be a" - " descending path, relative to the kubelet's configured seccomp profile" - ' location. Must only be set if type is "Localhost".' - ), - ) - type: TypeModel = Field( - ..., - description=( - "type indicates which kind of seccomp profile will be applied. Valid" - " options are:\n\nLocalhost - a profile defined in a file on the node" - " should be used. RuntimeDefault - the container runtime default profile" - " should be used. Unconfined - no profile should be applied.\n\nPossible" - ' enum values:\n - `"Localhost"` indicates a profile defined in a file on' - " the node should be used. The file's location relative to" - ' /seccomp.\n - `"RuntimeDefault"` represents the default' - ' container runtime seccomp profile.\n - `"Unconfined"` indicates no' - " seccomp profile is applied (A.K.A. unconfined)." - ), - ) + localhost_profile: Annotated[ + Optional[str], + Field( + alias="localhostProfile", + description=( + "localhostProfile indicates a profile defined in a file on the node" + " should be used. The profile must be preconfigured on the node to" + " work. Must be a descending path, relative to the kubelet's" + " configured seccomp profile location. Must only be set if type is" + ' "Localhost".' + ), + ), + ] = None + type: Annotated[ + Type, + Field( + description=( + "type indicates which kind of seccomp profile will be applied. Valid" + " options are:\n\nLocalhost - a profile defined in a file on the node" + " should be used. RuntimeDefault - the container runtime default" + " profile should be used. Unconfined - no profile should be" + ' applied.\n\nPossible enum values:\n - `"Localhost"` indicates a' + " profile defined in a file on the node should be used. The file's" + " location relative to /seccomp.\n -" + ' `"RuntimeDefault"` represents the default container runtime seccomp' + ' profile.\n - `"Unconfined"` indicates no seccomp profile is applied' + " (A.K.A. unconfined)." + ) + ), + ] -class SecretEnvSource(BaseModel): - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field(default=None, description="Specify whether the Secret must be defined") +class WindowsSecurityContextOptions(BaseModel): + gmsa_credential_spec: Annotated[ + Optional[str], + Field( + alias="gmsaCredentialSpec", + description=( + "GMSACredentialSpec is where the GMSA admission webhook" + " (https://github.com/kubernetes-sigs/windows-gmsa) inlines the" + " contents of the GMSA credential spec named by the" + " GMSACredentialSpecName field." + ), + ), + ] = None + gmsa_credential_spec_name: Annotated[ + Optional[str], + Field( + alias="gmsaCredentialSpecName", + description=("GMSACredentialSpecName is the name of the GMSA credential spec to use."), + ), + ] = None + host_process: Annotated[ + Optional[bool], + Field( + alias="hostProcess", + description=( + "HostProcess determines if a container should be run as a 'Host" + " Process' container. This field is alpha-level and will only be" + " honored by components that enable the WindowsHostProcessContainers" + " feature flag. Setting this field without the feature flag will result" + " in errors when validating the Pod. All of a Pod's containers must" + " have the same effective HostProcess value (it is not allowed to have" + " a mix of HostProcess containers and non-HostProcess containers). In" + " addition, if HostProcess is true then HostNetwork must also be set to" + " true." + ), + ), + ] = None + run_as_user_name: Annotated[ + Optional[str], + Field( + alias="runAsUserName", + description=( + "The UserName in Windows to run the entrypoint of the container" + " process. Defaults to the user specified in image metadata if" + " unspecified. May also be set in PodSecurityContext. If set in both" + " SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence." + ), + ), + ] = None -class SecretKeySelector(BaseModel): - key: str = Field( - ..., - description=("The key of the secret to select from. Must be a valid secret key."), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the Secret or its key must be defined", - ) +class PortworxVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "FSType represents the filesystem type to mount Must be a filesystem" + ' type supported by the host operating system. Ex. "ext4", "xfs".' + ' Implicitly inferred to be "ext4" if unspecified.' + ), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), + ), + ] = None + volume_id: Annotated[ + str, + Field( + alias="volumeID", + description="VolumeID uniquely identifies a Portworx volume", + ), + ] + + +class QuobyteVolumeSource(BaseModel): + group: Annotated[ + Optional[str], + Field(description="Group to map volume access to Default is no group"), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the Quobyte volume to be mounted with" + " read-only permissions. Defaults to false." + ), + ), + ] = None + registry: Annotated[ + str, + Field( + description=( + "Registry represents a single or multiple Quobyte Registry services" + " specified as a string as host:port pair (multiple entries are" + " separated with commas) which acts as the central registry for volumes" + ) + ), + ] + tenant: Annotated[ + Optional[str], + Field( + description=( + "Tenant owning the given Quobyte volume in the Backend Used with" + " dynamically provisioned Quobyte volumes, value is set by the plugin" + ) + ), + ] = None + user: Annotated[ + Optional[str], + Field(description="User to map volume access to Defaults to serivceaccount user"), + ] = None + volume: Annotated[ + str, + Field(description=("Volume is a string that references an already created Quobyte volume" " by name.")), + ] class SecretProjection(BaseModel): - items: Optional[List[KeyToPath]] = Field( - default=None, - description=( - "If unspecified, each key-value pair in the Data field of the referenced" - " Secret will be projected into the volume as a file whose name is the key" - " and content is the value. If specified, the listed keys will be projected" - " into the specified paths, and unlisted keys will not be present. If a key" - " is specified which is not present in the Secret, the volume setup will" - " error unless it is marked optional. Paths must be relative and may not" - " contain the '..' path or start with '..'." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the Secret or its key must be defined", - ) + items: Annotated[ + Optional[List[KeyToPath]], + Field( + description=( + "If unspecified, each key-value pair in the Data field of the" + " referenced Secret will be projected into the volume as a file whose" + " name is the key and content is the value. If specified, the listed" + " keys will be projected into the specified paths, and unlisted keys" + " will not be present. If a key is specified which is not present in" + " the Secret, the volume setup will error unless it is marked optional." + " Paths must be relative and may not contain the '..' path or start" + " with '..'." + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the Secret or its key must be defined"), + ] = None class SecretVolumeSource(BaseModel): - default_mode: Optional[int] = Field( - default=None, - alias="defaultMode", - description=( - "Optional: mode bits used to set permissions on created files by default." - " Must be an octal value between 0000 and 0777 or a decimal value between 0" - " and 511. YAML accepts both octal and decimal values, JSON requires" - " decimal values for mode bits. Defaults to 0644. Directories within the" - " path are not affected by this setting. This might be in conflict with" - " other options that affect the file mode, like fsGroup, and the result can" - " be other mode bits set." - ), - ) - items: Optional[List[KeyToPath]] = Field( - default=None, - description=( - "If unspecified, each key-value pair in the Data field of the referenced" - " Secret will be projected into the volume as a file whose name is the key" - " and content is the value. If specified, the listed keys will be projected" - " into the specified paths, and unlisted keys will not be present. If a key" - " is specified which is not present in the Secret, the volume setup will" - " error unless it is marked optional. Paths must be relative and may not" - " contain the '..' path or start with '..'." - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the Secret or its keys must be defined", - ) - secret_name: Optional[str] = Field( - default=None, - alias="secretName", - description=( - "Name of the secret in the pod's namespace to use. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#secret" - ), - ) + default_mode: Annotated[ + Optional[int], + Field( + alias="defaultMode", + description=( + "Optional: mode bits used to set permissions on created files by" + " default. Must be an octal value between 0000 and 0777 or a decimal" + " value between 0 and 511. YAML accepts both octal and decimal values," + " JSON requires decimal values for mode bits. Defaults to 0644." + " Directories within the path are not affected by this setting. This" + " might be in conflict with other options that affect the file mode," + " like fsGroup, and the result can be other mode bits set." + ), + ), + ] = None + items: Annotated[ + Optional[List[KeyToPath]], + Field( + description=( + "If unspecified, each key-value pair in the Data field of the" + " referenced Secret will be projected into the volume as a file whose" + " name is the key and content is the value. If specified, the listed" + " keys will be projected into the specified paths, and unlisted keys" + " will not be present. If a key is specified which is not present in" + " the Secret, the volume setup will error unless it is marked optional." + " Paths must be relative and may not contain the '..' path or start" + " with '..'." + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the Secret or its keys must be defined"), + ] = None + secret_name: Annotated[ + Optional[str], + Field( + alias="secretName", + description=( + "Name of the secret in the pod's namespace to use. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#secret" + ), + ), + ] = None class ServiceAccountTokenProjection(BaseModel): - audience: Optional[str] = Field( - default=None, - description=( - "Audience is the intended audience of the token. A recipient of a token" - " must identify itself with an identifier specified in the audience of the" - " token, and otherwise should reject the token. The audience defaults to" - " the identifier of the apiserver." - ), - ) - expiration_seconds: Optional[int] = Field( - default=None, - alias="expirationSeconds", - description=( - "ExpirationSeconds is the requested duration of validity of the service" - " account token. As the token approaches expiration, the kubelet volume" - " plugin will proactively rotate the service account token. The kubelet" - " will start trying to rotate the token if the token is older than 80" - " percent of its time to live or if the token is older than 24" - " hours.Defaults to 1 hour and must be at least 10 minutes." - ), - ) - path: str = Field( - ..., - description=("Path is the path relative to the mount point of the file to project the" " token into."), - ) - - -class StorageOSVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=( - "SecretRef specifies the secret to use for obtaining the StorageOS API" - " credentials. If not specified, default values will be attempted." - ), - ) - volume_name: Optional[str] = Field( - default=None, - alias="volumeName", - description=( - "VolumeName is the human-readable name of the StorageOS volume. Volume" - " names are only unique within a namespace." - ), - ) - volume_namespace: Optional[str] = Field( - default=None, - alias="volumeNamespace", - description=( - "VolumeNamespace specifies the scope of the volume within StorageOS. If no" - " namespace is specified then the Pod's namespace will be used. This" - " allows the Kubernetes name scoping to be mirrored within StorageOS for" - " tighter integration. Set VolumeName to any name to override the default" - ' behaviour. Set to "default" if you are not using namespaces within' - " StorageOS. Namespaces that do not pre-exist within StorageOS will be" - " created." - ), - ) + audience: Annotated[ + Optional[str], + Field( + description=( + "Audience is the intended audience of the token. A recipient of a token" + " must identify itself with an identifier specified in the audience of" + " the token, and otherwise should reject the token. The audience" + " defaults to the identifier of the apiserver." + ) + ), + ] = None + expiration_seconds: Annotated[ + Optional[int], + Field( + alias="expirationSeconds", + description=( + "ExpirationSeconds is the requested duration of validity of the service" + " account token. As the token approaches expiration, the kubelet volume" + " plugin will proactively rotate the service account token. The kubelet" + " will start trying to rotate the token if the token is older than 80" + " percent of its time to live or if the token is older than 24" + " hours.Defaults to 1 hour and must be at least 10 minutes." + ), + ), + ] = None + path: Annotated[ + str, + Field(description=("Path is the path relative to the mount point of the file to project" " the token into.")), + ] class Sysctl(BaseModel): - name: str = Field(..., description="Name of a property to set") - value: str = Field(..., description="Value of a property to set") + name: Annotated[str, Field(description="Name of a property to set")] + value: Annotated[str, Field(description="Value of a property to set")] class Effect(Enum): @@ -1045,191 +1087,171 @@ class OperatorModel(Enum): class Toleration(BaseModel): - effect: Optional[Effect] = Field( - default=None, - description=( - "Effect indicates the taint effect to match. Empty means match all taint" - " effects. When specified, allowed values are NoSchedule, PreferNoSchedule" - ' and NoExecute.\n\nPossible enum values:\n - `"NoExecute"` Evict any' - " already-running pods that do not tolerate the taint. Currently enforced" - ' by NodeController.\n - `"NoSchedule"` Do not allow new pods to schedule' - " onto the node unless they tolerate the taint, but allow all pods" - " submitted to Kubelet without going through the scheduler to start, and" - " allow all already-running pods to continue running. Enforced by the" - ' scheduler.\n - `"PreferNoSchedule"` Like TaintEffectNoSchedule, but the' - " scheduler tries not to schedule new pods onto the node, rather than" - " prohibiting new pods from scheduling onto the node entirely. Enforced by" - " the scheduler." - ), - ) - key: Optional[str] = Field( - default=None, - description=( - "Key is the taint key that the toleration applies to. Empty means match all" - " taint keys. If the key is empty, operator must be Exists; this" - " combination means to match all values and all keys." - ), - ) - operator: Optional[OperatorModel] = Field( - default=None, - description=( - "Operator represents a key's relationship to the value. Valid operators" - " are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard" - " for value, so that a pod can tolerate all taints of a particular" - ' category.\n\nPossible enum values:\n - `"Equal"`\n - `"Exists"`' - ), - ) - toleration_seconds: Optional[int] = Field( - default=None, - alias="tolerationSeconds", - description=( - "TolerationSeconds represents the period of time the toleration (which must" - " be of effect NoExecute, otherwise this field is ignored) tolerates the" - " taint. By default, it is not set, which means tolerate the taint forever" - " (do not evict). Zero and negative values will be treated as 0 (evict" - " immediately) by the system." - ), - ) - value: Optional[str] = Field( - default=None, - description=( - "Value is the taint value the toleration matches to. If the operator is" - " Exists, the value should be empty, otherwise just a regular string." - ), - ) + effect: Annotated[ + Optional[Effect], + Field( + description=( + "Effect indicates the taint effect to match. Empty means match all" + " taint effects. When specified, allowed values are NoSchedule," + " PreferNoSchedule and NoExecute.\n\nPossible enum values:\n -" + ' `"NoExecute"` Evict any already-running pods that do not tolerate the' + ' taint. Currently enforced by NodeController.\n - `"NoSchedule"` Do' + " not allow new pods to schedule onto the node unless they tolerate the" + " taint, but allow all pods submitted to Kubelet without going through" + " the scheduler to start, and allow all already-running pods to" + ' continue running. Enforced by the scheduler.\n - `"PreferNoSchedule"`' + " Like TaintEffectNoSchedule, but the scheduler tries not to schedule" + " new pods onto the node, rather than prohibiting new pods from" + " scheduling onto the node entirely. Enforced by the scheduler." + ) + ), + ] = None + key: Annotated[ + Optional[str], + Field( + description=( + "Key is the taint key that the toleration applies to. Empty means match" + " all taint keys. If the key is empty, operator must be Exists; this" + " combination means to match all values and all keys." + ) + ), + ] = None + operator: Annotated[ + Optional[OperatorModel], + Field( + description=( + "Operator represents a key's relationship to the value. Valid" + " operators are Exists and Equal. Defaults to Equal. Exists is" + " equivalent to wildcard for value, so that a pod can tolerate all" + " taints of a particular category.\n\nPossible enum values:\n -" + ' `"Equal"`\n - `"Exists"`' + ) + ), + ] = None + toleration_seconds: Annotated[ + Optional[int], + Field( + alias="tolerationSeconds", + description=( + "TolerationSeconds represents the period of time the toleration (which" + " must be of effect NoExecute, otherwise this field is ignored)" + " tolerates the taint. By default, it is not set, which means tolerate" + " the taint forever (do not evict). Zero and negative values will be" + " treated as 0 (evict immediately) by the system." + ), + ), + ] = None + value: Annotated[ + Optional[str], + Field( + description=( + "Value is the taint value the toleration matches to. If the operator is" + " Exists, the value should be empty, otherwise just a regular string." + ) + ), + ] = None -class TypedLocalObjectReference(BaseModel): - api_group: Optional[str] = Field( - default=None, - alias="apiGroup", - description=( - "APIGroup is the group for the resource being referenced. If APIGroup is" - " not specified, the specified Kind must be in the core API group. For any" - " other third-party types, APIGroup is required." - ), - ) - kind: str = Field(..., description="Kind is the type of resource being referenced") - name: str = Field(..., description="Name is the name of resource being referenced") +class VsphereVirtualDiskVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + storage_policy_id: Annotated[ + Optional[str], + Field( + alias="storagePolicyID", + description=( + "Storage Policy Based Management (SPBM) profile ID associated with the" " StoragePolicyName." + ), + ), + ] = None + storage_policy_name: Annotated[ + Optional[str], + Field( + alias="storagePolicyName", + description="Storage Policy Based Management (SPBM) profile name.", + ), + ] = None + volume_path: Annotated[ + str, + Field(alias="volumePath", description="Path that identifies vSphere volume vmdk"), + ] class VolumeDevice(BaseModel): - device_path: str = Field( - ..., - alias="devicePath", - description=("devicePath is the path inside of the container that the device will be" " mapped to."), - ) - name: str = Field( - ..., - description="name must match the name of a persistentVolumeClaim in the pod", - ) + device_path: Annotated[ + str, + Field( + alias="devicePath", + description=("devicePath is the path inside of the container that the device will be" " mapped to."), + ), + ] + name: Annotated[ + str, + Field(description="name must match the name of a persistentVolumeClaim in the pod"), + ] class VolumeMount(BaseModel): - mount_path: str = Field( - ..., - alias="mountPath", - description=("Path within the container at which the volume should be mounted. Must not" " contain ':'."), - ) - mount_propagation: Optional[str] = Field( - default=None, - alias="mountPropagation", - description=( - "mountPropagation determines how mounts are propagated from the host to" - " container and the other way around. When not set, MountPropagationNone is" - " used. This field is beta in 1.10." - ), - ) - name: str = Field(..., description="This must match the Name of a Volume.") - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=("Mounted read-only if true, read-write otherwise (false or unspecified)." " Defaults to false."), - ) - sub_path: Optional[str] = Field( - default=None, - alias="subPath", - description=( - "Path within the volume from which the container's volume should be" - ' mounted. Defaults to "" (volume\'s root).' - ), - ) - sub_path_expr: Optional[str] = Field( - default=None, - alias="subPathExpr", - description=( - "Expanded path within the volume from which the container's volume should" - " be mounted. Behaves similarly to SubPath but environment variable" - " references $(VAR_NAME) are expanded using the container's environment." - ' Defaults to "" (volume\'s root). SubPathExpr and SubPath are mutually' - " exclusive." - ), - ) - - -class VsphereVirtualDiskVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be' - ' "ext4" if unspecified.' - ), - ) - storage_policy_id: Optional[str] = Field( - default=None, - alias="storagePolicyID", - description=("Storage Policy Based Management (SPBM) profile ID associated with the" " StoragePolicyName."), - ) - storage_policy_name: Optional[str] = Field( - default=None, - alias="storagePolicyName", - description="Storage Policy Based Management (SPBM) profile name.", - ) - volume_path: str = Field(..., alias="volumePath", description="Path that identifies vSphere volume vmdk") - - -class WindowsSecurityContextOptions(BaseModel): - gmsa_credential_spec: Optional[str] = Field( - default=None, - alias="gmsaCredentialSpec", - description=( - "GMSACredentialSpec is where the GMSA admission webhook" - " (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of" - " the GMSA credential spec named by the GMSACredentialSpecName field." - ), - ) - gmsa_credential_spec_name: Optional[str] = Field( - default=None, - alias="gmsaCredentialSpecName", - description=("GMSACredentialSpecName is the name of the GMSA credential spec to use."), - ) - host_process: Optional[bool] = Field( - default=None, - alias="hostProcess", - description=( - "HostProcess determines if a container should be run as a 'Host Process'" - " container. This field is alpha-level and will only be honored by" - " components that enable the WindowsHostProcessContainers feature flag." - " Setting this field without the feature flag will result in errors when" - " validating the Pod. All of a Pod's containers must have the same" - " effective HostProcess value (it is not allowed to have a mix of" - " HostProcess containers and non-HostProcess containers). In addition, if" - " HostProcess is true then HostNetwork must also be set to true." - ), - ) - run_as_user_name: Optional[str] = Field( - default=None, - alias="runAsUserName", - description=( - "The UserName in Windows to run the entrypoint of the container process." - " Defaults to the user specified in image metadata if unspecified. May also" - " be set in PodSecurityContext. If set in both SecurityContext and" - " PodSecurityContext, the value specified in SecurityContext takes" - " precedence." - ), - ) + mount_path: Annotated[ + str, + Field( + alias="mountPath", + description=("Path within the container at which the volume should be mounted. Must" " not contain ':'."), + ), + ] + mount_propagation: Annotated[ + Optional[str], + Field( + alias="mountPropagation", + description=( + "mountPropagation determines how mounts are propagated from the host to" + " container and the other way around. When not set," + " MountPropagationNone is used. This field is beta in 1.10." + ), + ), + ] = None + name: Annotated[str, Field(description="This must match the Name of a Volume.")] + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Mounted read-only if true, read-write otherwise (false or" " unspecified). Defaults to false." + ), + ), + ] = None + sub_path: Annotated[ + Optional[str], + Field( + alias="subPath", + description=( + "Path within the volume from which the container's volume should be" + ' mounted. Defaults to "" (volume\'s root).' + ), + ), + ] = None + sub_path_expr: Annotated[ + Optional[str], + Field( + alias="subPathExpr", + description=( + "Expanded path within the volume from which the container's volume" + " should be mounted. Behaves similarly to SubPath but environment" + " variable references $(VAR_NAME) are expanded using the container's" + ' environment. Defaults to "" (volume\'s root). SubPathExpr and SubPath' + " are mutually exclusive." + ), + ), + ] = None class ImagePullPolicy(Enum): @@ -1238,1995 +1260,2683 @@ class ImagePullPolicy(Enum): if_not_present = "IfNotPresent" +class TypeModel(Enum): + file_system_resize_pending = "FileSystemResizePending" + resizing = "Resizing" + + +class PersistentVolumeClaimCondition(BaseModel): + last_probe_time: Annotated[ + Optional[v1.Time], + Field(alias="lastProbeTime", description="Last time we probed the condition."), + ] = None + last_transition_time: Annotated[ + Optional[v1.Time], + Field( + alias="lastTransitionTime", + description=("Last time the condition transitioned from one status to another."), + ), + ] = None + message: Annotated[ + Optional[str], + Field(description=("Human-readable message indicating details about last transition.")), + ] = None + reason: Annotated[ + Optional[str], + Field( + description=( + "Unique, this should be a short, machine understandable string that" + " gives the reason for condition's last transition. If it reports" + ' "ResizeStarted" that means the underlying persistent volume is being' + " resized." + ) + ), + ] = None + status: str + type: Annotated[ + TypeModel, + Field( + description=( + '\n\n\nPossible enum values:\n - `"FileSystemResizePending"` -' + " controller resize is finished and a file system resize is pending on" + ' node\n - `"Resizing"` - a user trigger resize of pvc has been started' + ) + ), + ] + + +class ServicePort(BaseModel): + app_protocol: Annotated[ + Optional[str], + Field( + alias="appProtocol", + description=( + "The application protocol for this port. This field follows standard" + " Kubernetes label syntax. Un-prefixed names are reserved for IANA" + " standard service names (as per RFC-6335 and" + " http://www.iana.org/assignments/service-names). Non-standard" + " protocols should use prefixed names such as" + " mycompany.com/my-custom-protocol." + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "The name of this port within the service. This must be a DNS_LABEL." + " All ports within a ServiceSpec must have unique names. When" + " considering the endpoints for a Service, this must match the 'name'" + " field in the EndpointPort. Optional if only one ServicePort is" + " defined on this service." + ) + ), + ] = None + node_port: Annotated[ + Optional[int], + Field( + alias="nodePort", + description=( + "The port on each node on which this service is exposed when type is" + " NodePort or LoadBalancer. Usually assigned by the system. If a value" + " is specified, in-range, and not in use it will be used, otherwise the" + " operation will fail. If not specified, a port will be allocated if" + " this Service requires one. If this field is specified when creating" + " a Service which does not need it, creation will fail. This field will" + " be wiped when updating a Service to no longer need it (e.g. changing" + " type from NodePort to ClusterIP). More info:" + " https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" + ), + ), + ] = None + port: Annotated[int, Field(description="The port that will be exposed by this service.")] + protocol: Annotated[ + Optional[Protocol], + Field( + description=( + 'The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".' + ' Default is TCP.\n\nPossible enum values:\n - `"SCTP"` is the SCTP' + ' protocol.\n - `"TCP"` is the TCP protocol.\n - `"UDP"` is the UDP' + " protocol." + ) + ), + ] = None + target_port: Annotated[ + Optional[intstr.IntOrString], + Field( + alias="targetPort", + description=( + "Number or name of the port to access on the pods targeted by the" + " service. Number must be in the range 1 to 65535. Name must be an" + " IANA_SVC_NAME. If this is a string, it will be looked up as a named" + " port in the target Pod's container ports. If this is not specified," + " the value of the 'port' field is used (an identity map). This field" + " is ignored for services with clusterIP=None, and should be omitted or" + " set equal to the 'port' field. More info:" + " https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service" + ), + ), + ] = None + + +class TCPSocketAction(BaseModel): + host: Annotated[ + Optional[str], + Field(description="Optional: Host name to connect to, defaults to the pod IP."), + ] = None + port: Annotated[ + intstr.IntOrString, + Field( + description=( + "Number or name of the port to access on the container. Number must be" + " in the range 1 to 65535. Name must be an IANA_SVC_NAME." + ) + ), + ] + + class CSIVolumeSource(BaseModel): - driver: str = Field( - ..., - description=( - "Driver is the name of the CSI driver that handles this volume. Consult" - " with your admin for the correct name as registered in the cluster." - ), - ) - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - 'Filesystem type to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the' - " empty value is passed to the associated CSI driver which will determine" - " the default filesystem to apply." - ), - ) - node_publish_secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="nodePublishSecretRef", - description=( - "NodePublishSecretRef is a reference to the secret object containing" - " sensitive information to pass to the CSI driver to complete the CSI" - " NodePublishVolume and NodeUnpublishVolume calls. This field is optional," - " and may be empty if no secret is required. If the secret object contains" - " more than one secret, all secret references are passed." - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=("Specifies a read-only configuration for the volume. Defaults to false" " (read/write)."), - ) - volume_attributes: Optional[Dict[str, str]] = Field( - default=None, - alias="volumeAttributes", - description=( - "VolumeAttributes stores driver-specific properties that are passed to the" - " CSI driver. Consult your driver's documentation for supported values." - ), - ) + driver: Annotated[ + str, + Field( + description=( + "Driver is the name of the CSI driver that handles this volume. Consult" + " with your admin for the correct name as registered in the cluster." + ) + ), + ] + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + 'Filesystem type to mount. Ex. "ext4", "xfs", "ntfs". If not provided,' + " the empty value is passed to the associated CSI driver which will" + " determine the default filesystem to apply." + ), + ), + ] = None + node_publish_secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="nodePublishSecretRef", + description=( + "NodePublishSecretRef is a reference to the secret object containing" + " sensitive information to pass to the CSI driver to complete the CSI" + " NodePublishVolume and NodeUnpublishVolume calls. This field is" + " optional, and may be empty if no secret is required. If the secret" + " object contains more than one secret, all secret references are" + " passed." + ), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=("Specifies a read-only configuration for the volume. Defaults to false" " (read/write)."), + ), + ] = None + volume_attributes: Annotated[ + Optional[Dict[str, str]], + Field( + alias="volumeAttributes", + description=( + "VolumeAttributes stores driver-specific properties that are passed to" + " the CSI driver. Consult your driver's documentation for supported" + " values." + ), + ), + ] = None class CephFSVolumeSource(BaseModel): - monitors: List[str] = Field( - ..., - description=( - "Required: Monitors is a collection of Ceph monitors More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) - path: Optional[str] = Field( - default=None, - description=("Optional: Used as the mounted root, rather than the full Ceph tree," " default is /"), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Optional: Defaults to false (read/write). ReadOnly here will force the" - " ReadOnly setting in VolumeMounts. More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) - secret_file: Optional[str] = Field( - default=None, - alias="secretFile", - description=( - "Optional: SecretFile is the path to key ring for User, default is" - " /etc/ceph/user.secret More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=( - "Optional: SecretRef is reference to the authentication secret for User," - " default is empty. More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) - user: Optional[str] = Field( - default=None, - description=( - "Optional: User is the rados user name, default is admin More info:" - " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" - ), - ) + monitors: Annotated[ + List[str], + Field( + description=( + "Required: Monitors is a collection of Ceph monitors More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ) + ), + ] + path: Annotated[ + Optional[str], + Field(description=("Optional: Used as the mounted root, rather than the full Ceph tree," " default is /")), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Optional: Defaults to false (read/write). ReadOnly here will force the" + " ReadOnly setting in VolumeMounts. More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ), + ), + ] = None + secret_file: Annotated[ + Optional[str], + Field( + alias="secretFile", + description=( + "Optional: SecretFile is the path to key ring for User, default is" + " /etc/ceph/user.secret More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=( + "Optional: SecretRef is reference to the authentication secret for" + " User, default is empty. More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ), + ), + ] = None + user: Annotated[ + Optional[str], + Field( + description=( + "Optional: User is the rados user name, default is admin More info:" + " https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it" + ) + ), + ] = None class CinderVolumeSource(BaseModel): - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to' - ' be "ext4" if unspecified. More info:' - " https://examples.k8s.io/mysql-cinder-pd/README.md" - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Optional: Defaults to false (read/write). ReadOnly here will force the" - " ReadOnly setting in VolumeMounts. More info:" - " https://examples.k8s.io/mysql-cinder-pd/README.md" - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=("Optional: points to a secret object containing parameters used to connect" " to OpenStack."), - ) - volume_id: str = Field( - ..., - alias="volumeID", - description=( - "volume id used to identify the volume in cinder. More info:" - " https://examples.k8s.io/mysql-cinder-pd/README.md" - ), - ) + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly' + ' inferred to be "ext4" if unspecified. More info:' + " https://examples.k8s.io/mysql-cinder-pd/README.md" + ), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Optional: Defaults to false (read/write). ReadOnly here will force the" + " ReadOnly setting in VolumeMounts. More info:" + " https://examples.k8s.io/mysql-cinder-pd/README.md" + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=("Optional: points to a secret object containing parameters used to" " connect to OpenStack."), + ), + ] = None + volume_id: Annotated[ + str, + Field( + alias="volumeID", + description=( + "volume id used to identify the volume in cinder. More info:" + " https://examples.k8s.io/mysql-cinder-pd/README.md" + ), + ), + ] -class ConfigMapProjection(BaseModel): - items: Optional[List[KeyToPath]] = Field( - default=None, - description=( - "If unspecified, each key-value pair in the Data field of the referenced" - " ConfigMap will be projected into the volume as a file whose name is the" - " key and content is the value. If specified, the listed keys will be" - " projected into the specified paths, and unlisted keys will not be" - " present. If a key is specified which is not present in the ConfigMap, the" - " volume setup will error unless it is marked optional. Paths must be" - " relative and may not contain the '..' path or start with '..'." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the ConfigMap or its keys must be defined", - ) +class FlexVolumeSource(BaseModel): + driver: Annotated[ + str, + Field(description="Driver is the name of the driver to use for this volume."), + ] + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". The default' + " filesystem depends on FlexVolume script." + ), + ), + ] = None + options: Annotated[ + Optional[Dict[str, str]], + Field(description="Optional: Extra command options if any."), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Optional: Defaults to false (read/write). ReadOnly here will force the" + " ReadOnly setting in VolumeMounts." + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=( + "Optional: SecretRef is reference to the secret object containing" + " sensitive information to pass to the plugin scripts. This may be" + " empty if no secret object is specified. If the secret object contains" + " more than one secret, all secrets are passed to the plugin scripts." + ), + ), + ] = None -class ConfigMapVolumeSource(BaseModel): - default_mode: Optional[int] = Field( - default=None, - alias="defaultMode", - description=( - "Optional: mode bits used to set permissions on created files by default." - " Must be an octal value between 0000 and 0777 or a decimal value between 0" - " and 511. YAML accepts both octal and decimal values, JSON requires" - " decimal values for mode bits. Defaults to 0644. Directories within the" - " path are not affected by this setting. This might be in conflict with" - " other options that affect the file mode, like fsGroup, and the result can" - " be other mode bits set." - ), - ) - items: Optional[List[KeyToPath]] = Field( - default=None, - description=( - "If unspecified, each key-value pair in the Data field of the referenced" - " ConfigMap will be projected into the volume as a file whose name is the" - " key and content is the value. If specified, the listed keys will be" - " projected into the specified paths, and unlisted keys will not be" - " present. If a key is specified which is not present in the ConfigMap, the" - " volume setup will error unless it is marked optional. Paths must be" - " relative and may not contain the '..' path or start with '..'." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the referent. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - optional: Optional[bool] = Field( - default=None, - description="Specify whether the ConfigMap or its keys must be defined", - ) +class ISCSIVolumeSource(BaseModel): + chap_auth_discovery: Annotated[ + Optional[bool], + Field( + alias="chapAuthDiscovery", + description="whether support iSCSI Discovery CHAP authentication", + ), + ] = None + chap_auth_session: Annotated[ + Optional[bool], + Field( + alias="chapAuthSession", + description="whether support iSCSI Session CHAP authentication", + ), + ] = None + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type of the volume that you want to mount. Tip: Ensure that" + " the filesystem type is supported by the host operating system." + ' Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if' + " unspecified. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#iscsi" + ), + ), + ] = None + initiator_name: Annotated[ + Optional[str], + Field( + alias="initiatorName", + description=( + "Custom iSCSI Initiator Name. If initiatorName is specified with" + " iscsiInterface simultaneously, new iSCSI interface : will be created for the connection." + ), + ), + ] = None + iqn: Annotated[str, Field(description="Target iSCSI Qualified Name.")] + iscsi_interface: Annotated[ + Optional[str], + Field( + alias="iscsiInterface", + description=("iSCSI Interface Name that uses an iSCSI transport. Defaults to" " 'default' (tcp)."), + ), + ] = None + lun: Annotated[int, Field(description="iSCSI Target Lun number.")] + portals: Annotated[ + Optional[List[str]], + Field( + description=( + "iSCSI Target Portal List. The portal is either an IP or ip_addr:port" + " if the port is other than default (typically TCP ports 860 and 3260)." + ) + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=("ReadOnly here will force the ReadOnly setting in VolumeMounts." " Defaults to false."), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description="CHAP Secret for iSCSI target and initiator authentication", + ), + ] = None + target_portal: Annotated[ + str, + Field( + alias="targetPortal", + description=( + "iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the" + " port is other than default (typically TCP ports 860 and 3260)." + ), + ), + ] -class EmptyDirVolumeSource(BaseModel): - medium: Optional[str] = Field( - default=None, - description=( - 'What type of storage medium should back this directory. The default is ""' - " which means to use the node's default medium. Must be an empty string" - " (default) or Memory. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#emptydir" - ), - ) - size_limit: Optional[resource.Quantity] = Field( - default=None, - alias="sizeLimit", - description=( - "Total amount of local storage required for this EmptyDir volume. The size" - " limit is also applicable for memory medium. The maximum usage on memory" - " medium EmptyDir would be the minimum value between the SizeLimit" - " specified here and the sum of memory limits of all containers in a pod." - " The default is nil which means that the limit is undefined. More info:" - " http://kubernetes.io/docs/user-guide/volumes#emptydir" - ), - ) +class RBDVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type of the volume that you want to mount. Tip: Ensure that" + " the filesystem type is supported by the host operating system." + ' Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if' + " unspecified. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#rbd" + ), + ), + ] = None + image: Annotated[ + str, + Field( + description=( + "The rados image name. More info:" " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] + keyring: Annotated[ + Optional[str], + Field( + description=( + "Keyring is the path to key ring for RBDUser. Default is" + " /etc/ceph/keyring. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] = None + monitors: Annotated[ + List[str], + Field( + description=( + "A collection of Ceph monitors. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] + pool: Annotated[ + Optional[str], + Field( + description=( + "The rados pool name. Default is rbd. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "ReadOnly here will force the ReadOnly setting in VolumeMounts." + " Defaults to false. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=( + "SecretRef is name of the authentication secret for RBDUser. If" + " provided overrides keyring. Default is nil. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ), + ), + ] = None + user: Annotated[ + Optional[str], + Field( + description=( + "The rados user name. Default is admin. More info:" + " https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it" + ) + ), + ] = None -class EnvFromSource(BaseModel): - config_map_ref: Optional[ConfigMapEnvSource] = Field( - default=None, alias="configMapRef", description="The ConfigMap to select from" - ) - prefix: Optional[str] = Field( - default=None, - description=("An optional identifier to prepend to each key in the ConfigMap. Must be a" " C_IDENTIFIER."), - ) - secret_ref: Optional[SecretEnvSource] = Field( - default=None, alias="secretRef", description="The Secret to select from" - ) +class ScaleIOVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs".' + ), + ), + ] = None + gateway: Annotated[str, Field(description="The host address of the ScaleIO API Gateway.")] + protection_domain: Annotated[ + Optional[str], + Field( + alias="protectionDomain", + description=("The name of the ScaleIO Protection Domain for the configured storage."), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), + ), + ] = None + secret_ref: Annotated[ + LocalObjectReference, + Field( + alias="secretRef", + description=( + "SecretRef references to the secret for ScaleIO user and other" + " sensitive information. If this is not provided, Login operation will" + " fail." + ), + ), + ] + ssl_enabled: Annotated[ + Optional[bool], + Field( + alias="sslEnabled", + description=("Flag to enable/disable SSL communication with Gateway, default false"), + ), + ] = None + storage_mode: Annotated[ + Optional[str], + Field( + alias="storageMode", + description=( + "Indicates whether the storage for a volume should be ThickProvisioned" + " or ThinProvisioned. Default is ThinProvisioned." + ), + ), + ] = None + storage_pool: Annotated[ + Optional[str], + Field( + alias="storagePool", + description=("The ScaleIO Storage Pool associated with the protection domain."), + ), + ] = None + system: Annotated[ + str, + Field(description="The name of the storage system as configured in ScaleIO."), + ] + volume_name: Annotated[ + Optional[str], + Field( + alias="volumeName", + description=( + "The name of a volume already created in the ScaleIO system that is" + " associated with this volume source." + ), + ), + ] = None -class EventSeries(BaseModel): - count: Optional[int] = Field( - default=None, - description=("Number of occurrences in this series up to the last heartbeat time"), - ) - last_observed_time: Optional[v1.MicroTime] = Field( - default=None, - alias="lastObservedTime", - description="Time of the last occurrence observed", - ) +class StorageOSVolumeSource(BaseModel): + fs_type: Annotated[ + Optional[str], + Field( + alias="fsType", + description=( + "Filesystem type to mount. Must be a filesystem type supported by the" + ' host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred' + ' to be "ext4" if unspecified.' + ), + ), + ] = None + read_only: Annotated[ + Optional[bool], + Field( + alias="readOnly", + description=( + "Defaults to false (read/write). ReadOnly here will force the ReadOnly" " setting in VolumeMounts." + ), + ), + ] = None + secret_ref: Annotated[ + Optional[LocalObjectReference], + Field( + alias="secretRef", + description=( + "SecretRef specifies the secret to use for obtaining the StorageOS API" + " credentials. If not specified, default values will be attempted." + ), + ), + ] = None + volume_name: Annotated[ + Optional[str], + Field( + alias="volumeName", + description=( + "VolumeName is the human-readable name of the StorageOS volume. Volume" + " names are only unique within a namespace." + ), + ), + ] = None + volume_namespace: Annotated[ + Optional[str], + Field( + alias="volumeNamespace", + description=( + "VolumeNamespace specifies the scope of the volume within StorageOS. " + " If no namespace is specified then the Pod's namespace will be used. " + " This allows the Kubernetes name scoping to be mirrored within" + " StorageOS for tighter integration. Set VolumeName to any name to" + ' override the default behaviour. Set to "default" if you are not using' + " namespaces within StorageOS. Namespaces that do not pre-exist within" + " StorageOS will be created." + ), + ), + ] = None -class FlexVolumeSource(BaseModel): - driver: str = Field(..., description="Driver is the name of the driver to use for this volume.") - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type to mount. Must be a filesystem type supported by the host" - ' operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem' - " depends on FlexVolume script." - ), - ) - options: Optional[Dict[str, str]] = Field(default=None, description="Optional: Extra command options if any.") - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=( - "Optional: Defaults to false (read/write). ReadOnly here will force the" - " ReadOnly setting in VolumeMounts." - ), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description=( - "Optional: SecretRef is reference to the secret object containing sensitive" - " information to pass to the plugin scripts. This may be empty if no secret" - " object is specified. If the secret object contains more than one secret," - " all secrets are passed to the plugin scripts." - ), - ) +class EmptyDirVolumeSource(BaseModel): + medium: Annotated[ + Optional[str], + Field( + description=( + "What type of storage medium should back this directory. The default is" + ' "" which means to use the node\'s default medium. Must be an empty' + " string (default) or Memory. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#emptydir" + ) + ), + ] = None + size_limit: Annotated[ + Optional[resource.Quantity], + Field( + alias="sizeLimit", + description=( + "Total amount of local storage required for this EmptyDir volume. The" + " size limit is also applicable for memory medium. The maximum usage on" + " memory medium EmptyDir would be the minimum value between the" + " SizeLimit specified here and the sum of memory limits of all" + " containers in a pod. The default is nil which means that the limit is" + " undefined. More info:" + " http://kubernetes.io/docs/user-guide/volumes#emptydir" + ), + ), + ] = None -class HTTPGetAction(BaseModel): - host: Optional[str] = Field( - default=None, - description=( - "Host name to connect to, defaults to the pod IP. You probably want to set" - ' "Host" in httpHeaders instead.' - ), - ) - http_headers: Optional[List[HTTPHeader]] = Field( - default=None, - alias="httpHeaders", - description=("Custom headers to set in the request. HTTP allows repeated headers."), - ) - path: Optional[str] = Field(default=None, description="Path to access on the HTTP server.") - port: int = Field( - ..., - description=( - "Name or number of the port to access on the container. Number must be in" - " the range 1 to 65535. Name must be an IANA_SVC_NAME." - ), - ) - scheme: Optional[Scheme] = Field( - default=None, - description=( - "Scheme to use for connecting to the host. Defaults to HTTP.\n\nPossible" - ' enum values:\n - `"HTTP"` means that the scheme used will be http://\n -' - ' `"HTTPS"` means that the scheme used will be https://' - ), - ) +class ResourceFieldSelector(BaseModel): + container_name: Annotated[ + Optional[str], + Field( + alias="containerName", + description="Container name: required for volumes, optional for env vars", + ), + ] = None + divisor: Annotated[ + Optional[resource.Quantity], + Field(description=('Specifies the output format of the exposed resources, defaults to "1"')), + ] = None + resource: Annotated[str, Field(description="Required: resource to select")] -class ISCSIVolumeSource(BaseModel): - chap_auth_discovery: Optional[bool] = Field( - default=None, - alias="chapAuthDiscovery", - description="whether support iSCSI Discovery CHAP authentication", - ) - chap_auth_session: Optional[bool] = Field( - default=None, - alias="chapAuthSession", - description="whether support iSCSI Session CHAP authentication", - ) - fs_type: Optional[str] = Field( - default=None, - alias="fsType", - description=( - "Filesystem type of the volume that you want to mount. Tip: Ensure that the" - " filesystem type is supported by the host operating system. Examples:" - ' "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.' - " More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi" - ), - ) - initiator_name: Optional[str] = Field( - default=None, - alias="initiatorName", - description=( - "Custom iSCSI Initiator Name. If initiatorName is specified with" - " iscsiInterface simultaneously, new iSCSI interface : will be created for the connection." - ), - ) - iqn: str = Field(..., description="Target iSCSI Qualified Name.") - iscsi_interface: Optional[str] = Field( - default=None, - alias="iscsiInterface", - description=("iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default'" " (tcp)."), - ) - lun: int = Field(..., description="iSCSI Target Lun number.") - portals: Optional[List[str]] = Field( - default=None, - description=( - "iSCSI Target Portal List. The portal is either an IP or ip_addr:port if" - " the port is other than default (typically TCP ports 860 and 3260)." - ), - ) - read_only: Optional[bool] = Field( - default=None, - alias="readOnly", - description=("ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to" " false."), - ) - secret_ref: Optional[LocalObjectReference] = Field( - default=None, - alias="secretRef", - description="CHAP Secret for iSCSI target and initiator authentication", - ) - target_portal: str = Field( - ..., - alias="targetPortal", - description=( - "iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the" - " port is other than default (typically TCP ports 860 and 3260)." - ), - ) +class EnvFromSource(BaseModel): + config_map_ref: Annotated[ + Optional[ConfigMapEnvSource], + Field(alias="configMapRef", description="The ConfigMap to select from"), + ] = None + prefix: Annotated[ + Optional[str], + Field( + description=("An optional identifier to prepend to each key in the ConfigMap. Must" " be a C_IDENTIFIER.") + ), + ] = None + secret_ref: Annotated[ + Optional[SecretEnvSource], + Field(alias="secretRef", description="The Secret to select from"), + ] = None -class NodeSelector(BaseModel): - node_selector_terms: List[NodeSelectorTerm] = Field( - ..., - alias="nodeSelectorTerms", - description="Required. A list of node selector terms. The terms are ORed.", - ) +class EventSeries(BaseModel): + count: Annotated[ + Optional[int], + Field(description=("Number of occurrences in this series up to the last heartbeat time")), + ] = None + last_observed_time: Annotated[ + Optional[v1.MicroTime], + Field(alias="lastObservedTime", description="Time of the last occurrence observed"), + ] = None -class PersistentVolumeClaimCondition(BaseModel): - last_probe_time: Optional[v1.Time] = Field( - default=None, - alias="lastProbeTime", - description="Last time we probed the condition.", - ) - last_transition_time: Optional[v1.Time] = Field( - default=None, - alias="lastTransitionTime", - description="Last time the condition transitioned from one status to another.", - ) - message: Optional[str] = Field( - default=None, - description="Human-readable message indicating details about last transition.", - ) - reason: Optional[str] = Field( - default=None, - description=( - "Unique, this should be a short, machine understandable string that gives" - " the reason for condition's last transition. If it reports" - ' "ResizeStarted" that means the underlying persistent volume is being' - " resized." - ), - ) - status: str - type: Type = Field( - ..., - description=( - '\n\n\nPossible enum values:\n - `"FileSystemResizePending"` - controller' - " resize is finished and a file system resize is pending on node\n -" - ' `"Resizing"` - a user trigger resize of pvc has been started' +class PreferredSchedulingTerm(BaseModel): + preference: Annotated[ + NodeSelectorTerm, + Field(description=("A node selector term, associated with the corresponding weight.")), + ] + weight: Annotated[ + int, + Field( + description=("Weight associated with matching the corresponding nodeSelectorTerm, in" " the range 1-100.") ), - ) + ] -class PersistentVolumeClaimStatus(BaseModel): - access_modes: Optional[List[str]] = Field( - default=None, - alias="accessModes", - description=( - "AccessModes contains the actual access modes the volume backing the PVC" - " has. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1" - ), - ) - allocated_resources: Optional[Dict[str, resource.Quantity]] = Field( - default=None, - alias="allocatedResources", - description=( - "The storage resource within AllocatedResources tracks the capacity" - " allocated to a PVC. It may be larger than the actual capacity when a" - " volume expansion operation is requested. For storage quota, the larger" - " value from allocatedResources and PVC.spec.resources is used. If" - " allocatedResources is not set, PVC.spec.resources alone is used for quota" - " calculation. If a volume expansion capacity request is lowered," - " allocatedResources is only lowered if there are no expansion operations" - " in progress and if the actual volume capacity is equal or lower than the" - " requested capacity. This is an alpha field and requires enabling" - " RecoverVolumeExpansionFailure feature." - ), - ) - capacity: Optional[Dict[str, resource.Quantity]] = Field( - default=None, - description="Represents the actual resources of the underlying volume.", - ) - conditions: Optional[List[PersistentVolumeClaimCondition]] = Field( - default=None, - description=( - "Current Condition of persistent volume claim. If underlying persistent" - " volume is being resized then the Condition will be set to" - " 'ResizeStarted'." - ), - ) - phase: Optional[Phase] = Field( - default=None, - description=( - "Phase represents the current phase of PersistentVolumeClaim.\n\nPossible" - ' enum values:\n - `"Bound"` used for PersistentVolumeClaims that are' - ' bound\n - `"Lost"` used for PersistentVolumeClaims that lost their' - " underlying PersistentVolume. The claim was bound to a PersistentVolume" - " and this volume does not exist any longer and all data on it was lost.\n" - ' - `"Pending"` used for PersistentVolumeClaims that are not yet bound' - ), - ) - resize_status: Optional[str] = Field( - default=None, - alias="resizeStatus", - description=( - "ResizeStatus stores status of resize operation. ResizeStatus is not set by" - " default but when expansion is complete resizeStatus is set to empty" - " string by resize controller or kubelet. This is an alpha field and" - " requires enabling RecoverVolumeExpansionFailure feature." - ), - ) +class PodSecurityContext(BaseModel): + fs_group: Annotated[ + Optional[int], + Field( + alias="fsGroup", + description=( + "A special supplemental group that applies to all containers in a pod." + " Some volume types allow the Kubelet to change the ownership of that" + " volume to be owned by the pod:\n\n1. The owning GID will be the" + " FSGroup 2. The setgid bit is set (new files created in the volume" + " will be owned by FSGroup) 3. The permission bits are OR'd with" + " rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and" + " permissions of any volume. Note that this field cannot be set when" + " spec.os.name is windows." + ), + ), + ] = None + fs_group_change_policy: Annotated[ + Optional[str], + Field( + alias="fsGroupChangePolicy", + description=( + "fsGroupChangePolicy defines behavior of changing ownership and" + " permission of the volume before being exposed inside Pod. This field" + " will only apply to volume types which support fsGroup based" + " ownership(and permissions). It will have no effect on ephemeral" + " volume types such as: secret, configmaps and emptydir. Valid values" + ' are "OnRootMismatch" and "Always". If not specified, "Always" is' + " used. Note that this field cannot be set when spec.os.name is" + " windows." + ), + ), + ] = None + run_as_group: Annotated[ + Optional[int], + Field( + alias="runAsGroup", + description=( + "The GID to run the entrypoint of the container process. Uses runtime" + " default if unset. May also be set in SecurityContext. If set in both" + " SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence for that container. Note that this" + " field cannot be set when spec.os.name is windows." + ), + ), + ] = None + run_as_non_root: Annotated[ + Optional[bool], + Field( + alias="runAsNonRoot", + description=( + "Indicates that the container must run as a non-root user. If true, the" + " Kubelet will validate the image at runtime to ensure that it does not" + " run as UID 0 (root) and fail to start the container if it does. If" + " unset or false, no such validation will be performed. May also be set" + " in SecurityContext. If set in both SecurityContext and" + " PodSecurityContext, the value specified in SecurityContext takes" + " precedence." + ), + ), + ] = None + run_as_user: Annotated[ + Optional[int], + Field( + alias="runAsUser", + description=( + "The UID to run the entrypoint of the container process. Defaults to" + " user specified in image metadata if unspecified. May also be set in" + " SecurityContext. If set in both SecurityContext and" + " PodSecurityContext, the value specified in SecurityContext takes" + " precedence for that container. Note that this field cannot be set" + " when spec.os.name is windows." + ), + ), + ] = None + se_linux_options: Annotated[ + Optional[SELinuxOptions], + Field( + alias="seLinuxOptions", + description=( + "The SELinux context to be applied to all containers. If unspecified," + " the container runtime will allocate a random SELinux context for each" + " container. May also be set in SecurityContext. If set in both" + " SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence for that container. Note that this" + " field cannot be set when spec.os.name is windows." + ), + ), + ] = None + seccomp_profile: Annotated[ + Optional[SeccompProfile], + Field( + alias="seccompProfile", + description=( + "The seccomp options to use by the containers in this pod. Note that" + " this field cannot be set when spec.os.name is windows." + ), + ), + ] = None + supplemental_groups: Annotated[ + Optional[List[int]], + Field( + alias="supplementalGroups", + description=( + "A list of groups applied to the first process run in each container," + " in addition to the container's primary GID. If unspecified, no" + " groups will be added to any container. Note that this field cannot be" + " set when spec.os.name is windows." + ), + ), + ] = None + sysctls: Annotated[ + Optional[List[Sysctl]], + Field( + description=( + "Sysctls hold a list of namespaced sysctls used for the pod. Pods with" + " unsupported sysctls (by the container runtime) might fail to launch." + " Note that this field cannot be set when spec.os.name is windows." + ) + ), + ] = None + windows_options: Annotated[ + Optional[WindowsSecurityContextOptions], + Field( + alias="windowsOptions", + description=( + "The Windows specific settings applied to all containers. If" + " unspecified, the options within a container's SecurityContext will be" + " used. If set in both SecurityContext and PodSecurityContext, the" + " value specified in SecurityContext takes precedence. Note that this" + " field cannot be set when spec.os.name is linux." + ), + ), + ] = None -class PodDNSConfig(BaseModel): - nameservers: Optional[List[str]] = Field( - default=None, - description=( - "A list of DNS name server IP addresses. This will be appended to the base" - " nameservers generated from DNSPolicy. Duplicated nameservers will be" - " removed." - ), - ) - options: Optional[List[PodDNSConfigOption]] = Field( - default=None, - description=( - "A list of DNS resolver options. This will be merged with the base options" - " generated from DNSPolicy. Duplicated entries will be removed. Resolution" - " options given in Options will override those that appear in the base" - " DNSPolicy." - ), - ) - searches: Optional[List[str]] = Field( - default=None, - description=( - "A list of DNS search domains for host-name lookup. This will be appended" - " to the base search paths generated from DNSPolicy. Duplicated search" - " paths will be removed." - ), - ) +class SecurityContext(BaseModel): + allow_privilege_escalation: Annotated[ + Optional[bool], + Field( + alias="allowPrivilegeEscalation", + description=( + "AllowPrivilegeEscalation controls whether a process can gain more" + " privileges than its parent process. This bool directly controls if" + " the no_new_privs flag will be set on the container process." + " AllowPrivilegeEscalation is true always when the container is: 1) run" + " as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set" + " when spec.os.name is windows." + ), + ), + ] = None + capabilities: Annotated[ + Optional[Capabilities], + Field( + description=( + "The capabilities to add/drop when running containers. Defaults to the" + " default set of capabilities granted by the container runtime. Note" + " that this field cannot be set when spec.os.name is windows." + ) + ), + ] = None + privileged: Annotated[ + Optional[bool], + Field( + description=( + "Run container in privileged mode. Processes in privileged containers" + " are essentially equivalent to root on the host. Defaults to false." + " Note that this field cannot be set when spec.os.name is windows." + ) + ), + ] = None + proc_mount: Annotated[ + Optional[str], + Field( + alias="procMount", + description=( + "procMount denotes the type of proc mount to use for the containers." + " The default is DefaultProcMount which uses the container runtime" + " defaults for readonly paths and masked paths. This requires the" + " ProcMountType feature flag to be enabled. Note that this field cannot" + " be set when spec.os.name is windows." + ), + ), + ] = None + read_only_root_filesystem: Annotated[ + Optional[bool], + Field( + alias="readOnlyRootFilesystem", + description=( + "Whether this container has a read-only root filesystem. Default is" + " false. Note that this field cannot be set when spec.os.name is" + " windows." + ), + ), + ] = None + run_as_group: Annotated[ + Optional[int], + Field( + alias="runAsGroup", + description=( + "The GID to run the entrypoint of the container process. Uses runtime" + " default if unset. May also be set in PodSecurityContext. If set in" + " both SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence. Note that this field cannot be set" + " when spec.os.name is windows." + ), + ), + ] = None + run_as_non_root: Annotated[ + Optional[bool], + Field( + alias="runAsNonRoot", + description=( + "Indicates that the container must run as a non-root user. If true, the" + " Kubelet will validate the image at runtime to ensure that it does not" + " run as UID 0 (root) and fail to start the container if it does. If" + " unset or false, no such validation will be performed. May also be set" + " in PodSecurityContext. If set in both SecurityContext and" + " PodSecurityContext, the value specified in SecurityContext takes" + " precedence." + ), + ), + ] = None + run_as_user: Annotated[ + Optional[int], + Field( + alias="runAsUser", + description=( + "The UID to run the entrypoint of the container process. Defaults to" + " user specified in image metadata if unspecified. May also be set in" + " PodSecurityContext. If set in both SecurityContext and" + " PodSecurityContext, the value specified in SecurityContext takes" + " precedence. Note that this field cannot be set when spec.os.name is" + " windows." + ), + ), + ] = None + se_linux_options: Annotated[ + Optional[SELinuxOptions], + Field( + alias="seLinuxOptions", + description=( + "The SELinux context to be applied to the container. If unspecified," + " the container runtime will allocate a random SELinux context for each" + " container. May also be set in PodSecurityContext. If set in both" + " SecurityContext and PodSecurityContext, the value specified in" + " SecurityContext takes precedence. Note that this field cannot be set" + " when spec.os.name is windows." + ), + ), + ] = None + seccomp_profile: Annotated[ + Optional[SeccompProfile], + Field( + alias="seccompProfile", + description=( + "The seccomp options to use by this container. If seccomp options are" + " provided at both the pod & container level, the container options" + " override the pod options. Note that this field cannot be set when" + " spec.os.name is windows." + ), + ), + ] = None + windows_options: Annotated[ + Optional[WindowsSecurityContextOptions], + Field( + alias="windowsOptions", + description=( + "The Windows specific settings applied to all containers. If" + " unspecified, the options from the PodSecurityContext will be used. If" + " set in both SecurityContext and PodSecurityContext, the value" + " specified in SecurityContext takes precedence. Note that this field" + " cannot be set when spec.os.name is linux." + ), + ), + ] = None -class PodSecurityContext(BaseModel): - fs_group: Optional[int] = Field( - default=None, - alias="fsGroup", - description=( - "A special supplemental group that applies to all containers in a pod. Some" - " volume types allow the Kubelet to change the ownership of that volume to" - " be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The" - " setgid bit is set (new files created in the volume will be owned by" - " FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the" - " Kubelet will not modify the ownership and permissions of any volume. Note" - " that this field cannot be set when spec.os.name is windows." - ), - ) - fs_group_change_policy: Optional[str] = Field( - default=None, - alias="fsGroupChangePolicy", - description=( - "fsGroupChangePolicy defines behavior of changing ownership and permission" - " of the volume before being exposed inside Pod. This field will only apply" - " to volume types which support fsGroup based ownership(and permissions)." - " It will have no effect on ephemeral volume types such as: secret," - ' configmaps and emptydir. Valid values are "OnRootMismatch" and "Always".' - ' If not specified, "Always" is used. Note that this field cannot be set' - " when spec.os.name is windows." - ), - ) - run_as_group: Optional[int] = Field( - default=None, - alias="runAsGroup", - description=( - "The GID to run the entrypoint of the container process. Uses runtime" - " default if unset. May also be set in SecurityContext. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence for that container. Note that this field" - " cannot be set when spec.os.name is windows." - ), - ) - run_as_non_root: Optional[bool] = Field( - default=None, - alias="runAsNonRoot", - description=( - "Indicates that the container must run as a non-root user. If true, the" - " Kubelet will validate the image at runtime to ensure that it does not run" - " as UID 0 (root) and fail to start the container if it does. If unset or" - " false, no such validation will be performed. May also be set in" - " SecurityContext. If set in both SecurityContext and PodSecurityContext," - " the value specified in SecurityContext takes precedence." - ), - ) - run_as_user: Optional[int] = Field( - default=None, - alias="runAsUser", - description=( - "The UID to run the entrypoint of the container process. Defaults to user" - " specified in image metadata if unspecified. May also be set in" - " SecurityContext. If set in both SecurityContext and PodSecurityContext," - " the value specified in SecurityContext takes precedence for that" - " container. Note that this field cannot be set when spec.os.name is" - " windows." - ), - ) - se_linux_options: Optional[SELinuxOptions] = Field( - default=None, - alias="seLinuxOptions", - description=( - "The SELinux context to be applied to all containers. If unspecified, the" - " container runtime will allocate a random SELinux context for each" - " container. May also be set in SecurityContext. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence for that container. Note that this field" - " cannot be set when spec.os.name is windows." - ), - ) - seccomp_profile: Optional[SeccompProfile] = Field( - default=None, - alias="seccompProfile", - description=( - "The seccomp options to use by the containers in this pod. Note that this" - " field cannot be set when spec.os.name is windows." - ), - ) - supplemental_groups: Optional[List[int]] = Field( - default=None, - alias="supplementalGroups", - description=( - "A list of groups applied to the first process run in each container, in" - " addition to the container's primary GID. If unspecified, no groups will" - " be added to any container. Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - sysctls: Optional[List[Sysctl]] = Field( - default=None, - description=( - "Sysctls hold a list of namespaced sysctls used for the pod. Pods with" - " unsupported sysctls (by the container runtime) might fail to launch. Note" - " that this field cannot be set when spec.os.name is windows." - ), - ) - windows_options: Optional[WindowsSecurityContextOptions] = Field( - default=None, - alias="windowsOptions", - description=( - "The Windows specific settings applied to all containers. If unspecified," - " the options within a container's SecurityContext will be used. If set in" - " both SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence. Note that this field cannot be set when" - " spec.os.name is linux." - ), - ) +class DownwardAPIVolumeFile(BaseModel): + field_ref: Annotated[ + Optional[ObjectFieldSelector], + Field( + alias="fieldRef", + description=( + "Required: Selects a field of the pod: only annotations, labels, name" " and namespace are supported." + ), + ), + ] = None + mode: Annotated[ + Optional[int], + Field( + description=( + "Optional: mode bits used to set permissions on this file, must be an" + " octal value between 0000 and 0777 or a decimal value between 0 and" + " 511. YAML accepts both octal and decimal values, JSON requires" + " decimal values for mode bits. If not specified, the volume" + " defaultMode will be used. This might be in conflict with other" + " options that affect the file mode, like fsGroup, and the result can" + " be other mode bits set." + ) + ), + ] = None + path: Annotated[ + str, + Field( + description=( + "Required: Path is the relative path name of the file to be created." + " Must not be absolute or contain the '..' path. Must be utf-8 encoded." + " The first item of the relative path must not start with '..'" + ) + ), + ] + resource_field_ref: Annotated[ + Optional[ResourceFieldSelector], + Field( + alias="resourceFieldRef", + description=( + "Selects a resource of the container: only resources limits and" + " requests (limits.cpu, limits.memory, requests.cpu and" + " requests.memory) are currently supported." + ), + ), + ] = None -class ResourceFieldSelector(BaseModel): - container_name: Optional[str] = Field( - default=None, - alias="containerName", - description="Container name: required for volumes, optional for env vars", - ) - divisor: Optional[resource.Quantity] = Field( - default=None, - description=('Specifies the output format of the exposed resources, defaults to "1"'), - ) - resource: str = Field(..., description="Required: resource to select") +class EnvVarSource(BaseModel): + config_map_key_ref: Annotated[ + Optional[ConfigMapKeySelector], + Field(alias="configMapKeyRef", description="Selects a key of a ConfigMap."), + ] = None + field_ref: Annotated[ + Optional[ObjectFieldSelector], + Field( + alias="fieldRef", + description=( + "Selects a field of the pod: supports metadata.name," + " metadata.namespace, `metadata.labels['']`," + " `metadata.annotations['']`, spec.nodeName," + " spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs." + ), + ), + ] = None + resource_field_ref: Annotated[ + Optional[ResourceFieldSelector], + Field( + alias="resourceFieldRef", + description=( + "Selects a resource of the container: only resources limits and" + " requests (limits.cpu, limits.memory, limits.ephemeral-storage," + " requests.cpu, requests.memory and requests.ephemeral-storage) are" + " currently supported." + ), + ), + ] = None + secret_key_ref: Annotated[ + Optional[SecretKeySelector], + Field( + alias="secretKeyRef", + description="Selects a key of a secret in the pod's namespace", + ), + ] = None + + +class EnvVar(BaseModel): + name: Annotated[ + str, + Field(description="Name of the environment variable. Must be a C_IDENTIFIER."), + ] + value: Annotated[ + Optional[str], + Field( + description=( + "Variable references $(VAR_NAME) are expanded using the previously" + " defined environment variables in the container and any service" + " environment variables. If a variable cannot be resolved, the" + " reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + ' of whether the variable exists or not. Defaults to "".' + ) + ), + ] = None + value_from: Annotated[ + Optional[EnvVarSource], + Field( + alias="valueFrom", + description=("Source for the environment variable's value. Cannot be used if value" " is not empty."), + ), + ] = None + + +class TerminationMessagePolicy(Enum): + fallback_to_logs_on_error = "FallbackToLogsOnError" + file = "File" class ResourceRequirements(BaseModel): - limits: Optional[Dict[str, resource.Quantity]] = Field( - default=None, - description=( - "Limits describes the maximum amount of compute resources allowed. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - requests: Optional[Dict[str, resource.Quantity]] = Field( - default=None, - description=( - "Requests describes the minimum amount of compute resources required. If" - " Requests is omitted for a container, it defaults to Limits if that is" - " explicitly specified, otherwise to an implementation-defined value. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) + limits: Annotated[ + Optional[Dict[str, resource.Quantity]], + Field( + description=( + "Limits describes the maximum amount of compute resources allowed. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + requests: Annotated[ + Optional[Dict[str, resource.Quantity]], + Field( + description=( + "Requests describes the minimum amount of compute resources required." + " If Requests is omitted for a container, it defaults to Limits if that" + " is explicitly specified, otherwise to an implementation-defined" + " value. More info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None -class SecurityContext(BaseModel): - allow_privilege_escalation: Optional[bool] = Field( - default=None, - alias="allowPrivilegeEscalation", - description=( - "AllowPrivilegeEscalation controls whether a process can gain more" - " privileges than its parent process. This bool directly controls if the" - " no_new_privs flag will be set on the container process." - " AllowPrivilegeEscalation is true always when the container is: 1) run as" - " Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - capabilities: Optional[Capabilities] = Field( - default=None, - description=( - "The capabilities to add/drop when running containers. Defaults to the" - " default set of capabilities granted by the container runtime. Note that" - " this field cannot be set when spec.os.name is windows." - ), - ) - privileged: Optional[bool] = Field( - default=None, - description=( - "Run container in privileged mode. Processes in privileged containers are" - " essentially equivalent to root on the host. Defaults to false. Note that" - " this field cannot be set when spec.os.name is windows." - ), - ) - proc_mount: Optional[str] = Field( - default=None, - alias="procMount", - description=( - "procMount denotes the type of proc mount to use for the containers. The" - " default is DefaultProcMount which uses the container runtime defaults for" - " readonly paths and masked paths. This requires the ProcMountType feature" - " flag to be enabled. Note that this field cannot be set when spec.os.name" - " is windows." - ), - ) - read_only_root_filesystem: Optional[bool] = Field( - default=None, - alias="readOnlyRootFilesystem", - description=( - "Whether this container has a read-only root filesystem. Default is false." - " Note that this field cannot be set when spec.os.name is windows." - ), - ) - run_as_group: Optional[int] = Field( - default=None, - alias="runAsGroup", - description=( - "The GID to run the entrypoint of the container process. Uses runtime" - " default if unset. May also be set in PodSecurityContext. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence. Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - run_as_non_root: Optional[bool] = Field( - default=None, - alias="runAsNonRoot", - description=( - "Indicates that the container must run as a non-root user. If true, the" - " Kubelet will validate the image at runtime to ensure that it does not run" - " as UID 0 (root) and fail to start the container if it does. If unset or" - " false, no such validation will be performed. May also be set in" - " PodSecurityContext. If set in both SecurityContext and" - " PodSecurityContext, the value specified in SecurityContext takes" - " precedence." - ), - ) - run_as_user: Optional[int] = Field( - default=None, - alias="runAsUser", - description=( - "The UID to run the entrypoint of the container process. Defaults to user" - " specified in image metadata if unspecified. May also be set in" - " PodSecurityContext. If set in both SecurityContext and" - " PodSecurityContext, the value specified in SecurityContext takes" - " precedence. Note that this field cannot be set when spec.os.name is" - " windows." - ), - ) - se_linux_options: Optional[SELinuxOptions] = Field( - default=None, - alias="seLinuxOptions", - description=( - "The SELinux context to be applied to the container. If unspecified, the" - " container runtime will allocate a random SELinux context for each" - " container. May also be set in PodSecurityContext. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence. Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - seccomp_profile: Optional[SeccompProfile] = Field( - default=None, - alias="seccompProfile", - description=( - "The seccomp options to use by this container. If seccomp options are" - " provided at both the pod & container level, the container options" - " override the pod options. Note that this field cannot be set when" - " spec.os.name is windows." - ), - ) - windows_options: Optional[WindowsSecurityContextOptions] = Field( - default=None, - alias="windowsOptions", - description=( - "The Windows specific settings applied to all containers. If unspecified," - " the options from the PodSecurityContext will be used. If set in both" - " SecurityContext and PodSecurityContext, the value specified in" - " SecurityContext takes precedence. Note that this field cannot be set when" - " spec.os.name is linux." - ), - ) +class PodDNSConfig(BaseModel): + nameservers: Annotated[ + Optional[List[str]], + Field( + description=( + "A list of DNS name server IP addresses. This will be appended to the" + " base nameservers generated from DNSPolicy. Duplicated nameservers" + " will be removed." + ) + ), + ] = None + options: Annotated[ + Optional[List[PodDNSConfigOption]], + Field( + description=( + "A list of DNS resolver options. This will be merged with the base" + " options generated from DNSPolicy. Duplicated entries will be removed." + " Resolution options given in Options will override those that appear" + " in the base DNSPolicy." + ) + ), + ] = None + searches: Annotated[ + Optional[List[str]], + Field( + description=( + "A list of DNS search domains for host-name lookup. This will be" + " appended to the base search paths generated from DNSPolicy." + " Duplicated search paths will be removed." + ) + ), + ] = None -class ServicePort(BaseModel): - app_protocol: Optional[str] = Field( - default=None, - alias="appProtocol", - description=( - "The application protocol for this port. This field follows standard" - " Kubernetes label syntax. Un-prefixed names are reserved for IANA standard" - " service names (as per RFC-6335 and" - " http://www.iana.org/assignments/service-names). Non-standard protocols" - " should use prefixed names such as mycompany.com/my-custom-protocol." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "The name of this port within the service. This must be a DNS_LABEL. All" - " ports within a ServiceSpec must have unique names. When considering the" - " endpoints for a Service, this must match the 'name' field in the" - " EndpointPort. Optional if only one ServicePort is defined on this" - " service." - ), - ) - node_port: Optional[int] = Field( - default=None, - alias="nodePort", - description=( - "The port on each node on which this service is exposed when type is" - " NodePort or LoadBalancer. Usually assigned by the system. If a value is" - " specified, in-range, and not in use it will be used, otherwise the" - " operation will fail. If not specified, a port will be allocated if this" - " Service requires one. If this field is specified when creating a Service" - " which does not need it, creation will fail. This field will be wiped when" - " updating a Service to no longer need it (e.g. changing type from NodePort" - " to ClusterIP). More info:" - " https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" - ), - ) - port: int = Field(..., description="The port that will be exposed by this service.") - protocol: Optional[Protocol] = Field( - default=None, - description=( - 'The IP protocol for this port. Supports "TCP", "UDP", and "SCTP". Default' - ' is TCP.\n\nPossible enum values:\n - `"SCTP"` is the SCTP protocol.\n -' - ' `"TCP"` is the TCP protocol.\n - `"UDP"` is the UDP protocol.' - ), - ) - target_port: Optional[intstr.IntOrString] = Field( - default=None, - alias="targetPort", - description=( - "Number or name of the port to access on the pods targeted by the service." - " Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If" - " this is a string, it will be looked up as a named port in the target" - " Pod's container ports. If this is not specified, the value of the 'port'" - " field is used (an identity map). This field is ignored for services with" - " clusterIP=None, and should be omitted or set equal to the 'port' field." - " More info:" - " https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service" - ), - ) +class ConfigMapProjection(BaseModel): + items: Annotated[ + Optional[List[KeyToPath]], + Field( + description=( + "If unspecified, each key-value pair in the Data field of the" + " referenced ConfigMap will be projected into the volume as a file" + " whose name is the key and content is the value. If specified, the" + " listed keys will be projected into the specified paths, and unlisted" + " keys will not be present. If a key is specified which is not present" + " in the ConfigMap, the volume setup will error unless it is marked" + " optional. Paths must be relative and may not contain the '..' path or" + " start with '..'." + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the ConfigMap or its keys must be defined"), + ] = None -class TCPSocketAction(BaseModel): - host: Optional[str] = Field( - default=None, - description="Optional: Host name to connect to, defaults to the pod IP.", - ) - port: intstr.IntOrString = Field( - ..., - description=( - "Number or name of the port to access on the container. Number must be in" - " the range 1 to 65535. Name must be an IANA_SVC_NAME." - ), - ) +class ConfigMapVolumeSource(BaseModel): + default_mode: Annotated[ + Optional[int], + Field( + alias="defaultMode", + description=( + "Optional: mode bits used to set permissions on created files by" + " default. Must be an octal value between 0000 and 0777 or a decimal" + " value between 0 and 511. YAML accepts both octal and decimal values," + " JSON requires decimal values for mode bits. Defaults to 0644." + " Directories within the path are not affected by this setting. This" + " might be in conflict with other options that affect the file mode," + " like fsGroup, and the result can be other mode bits set." + ), + ), + ] = None + items: Annotated[ + Optional[List[KeyToPath]], + Field( + description=( + "If unspecified, each key-value pair in the Data field of the" + " referenced ConfigMap will be projected into the volume as a file" + " whose name is the key and content is the value. If specified, the" + " listed keys will be projected into the specified paths, and unlisted" + " keys will not be present. If a key is specified which is not present" + " in the ConfigMap, the volume setup will error unless it is marked" + " optional. Paths must be relative and may not contain the '..' path or" + " start with '..'." + ) + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the referent. More info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] = None + optional: Annotated[ + Optional[bool], + Field(description="Specify whether the ConfigMap or its keys must be defined"), + ] = None -class DownwardAPIVolumeFile(BaseModel): - field_ref: Optional[ObjectFieldSelector] = Field( - default=None, - alias="fieldRef", - description=( - "Required: Selects a field of the pod: only annotations, labels, name and" " namespace are supported." - ), - ) - mode: Optional[int] = Field( - default=None, - description=( - "Optional: mode bits used to set permissions on this file, must be an octal" - " value between 0000 and 0777 or a decimal value between 0 and 511. YAML" - " accepts both octal and decimal values, JSON requires decimal values for" - " mode bits. If not specified, the volume defaultMode will be used. This" - " might be in conflict with other options that affect the file mode, like" - " fsGroup, and the result can be other mode bits set." - ), - ) - path: str = Field( - ..., - description=( - "Required: Path is the relative path name of the file to be created. Must" - " not be absolute or contain the '..' path. Must be utf-8 encoded. The" - " first item of the relative path must not start with '..'" - ), - ) - resource_field_ref: Optional[ResourceFieldSelector] = Field( - default=None, - alias="resourceFieldRef", - description=( - "Selects a resource of the container: only resources limits and requests" - " (limits.cpu, limits.memory, requests.cpu and requests.memory) are" - " currently supported." - ), - ) +class DownwardAPIProjection(BaseModel): + items: Annotated[ + Optional[List[DownwardAPIVolumeFile]], + Field(description="Items is a list of DownwardAPIVolume file"), + ] = None class DownwardAPIVolumeSource(BaseModel): - default_mode: Optional[int] = Field( - default=None, - alias="defaultMode", - description=( - "Optional: mode bits to use on created files by default. Must be a" - " Optional: mode bits used to set permissions on created files by default." - " Must be an octal value between 0000 and 0777 or a decimal value between 0" - " and 511. YAML accepts both octal and decimal values, JSON requires" - " decimal values for mode bits. Defaults to 0644. Directories within the" - " path are not affected by this setting. This might be in conflict with" - " other options that affect the file mode, like fsGroup, and the result can" - " be other mode bits set." - ), - ) - items: Optional[List[DownwardAPIVolumeFile]] = Field( - default=None, description="Items is a list of downward API volume file" - ) + default_mode: Annotated[ + Optional[int], + Field( + alias="defaultMode", + description=( + "Optional: mode bits to use on created files by default. Must be a" + " Optional: mode bits used to set permissions on created files by" + " default. Must be an octal value between 0000 and 0777 or a decimal" + " value between 0 and 511. YAML accepts both octal and decimal values," + " JSON requires decimal values for mode bits. Defaults to 0644." + " Directories within the path are not affected by this setting. This" + " might be in conflict with other options that affect the file mode," + " like fsGroup, and the result can be other mode bits set." + ), + ), + ] = None + items: Annotated[ + Optional[List[DownwardAPIVolumeFile]], + Field(description="Items is a list of downward API volume file"), + ] = None -class EnvVarSource(BaseModel): - config_map_key_ref: Optional[ConfigMapKeySelector] = Field( - default=None, - alias="configMapKeyRef", - description="Selects a key of a ConfigMap.", - ) - field_ref: Optional[ObjectFieldSelector] = Field( - default=None, - alias="fieldRef", - description=( - "Selects a field of the pod: supports metadata.name, metadata.namespace," - " `metadata.labels['']`, `metadata.annotations['']`," - " spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP," - " status.podIPs." - ), - ) - resource_field_ref: Optional[ResourceFieldSelector] = Field( - default=None, - alias="resourceFieldRef", - description=( - "Selects a resource of the container: only resources limits and requests" - " (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu," - " requests.memory and requests.ephemeral-storage) are currently supported." - ), - ) - secret_key_ref: Optional[SecretKeySelector] = Field( - default=None, - alias="secretKeyRef", - description="Selects a key of a secret in the pod's namespace", - ) +class HTTPGetAction(BaseModel): + host: Annotated[ + Optional[str], + Field( + description=( + "Host name to connect to, defaults to the pod IP. You probably want to" + ' set "Host" in httpHeaders instead.' + ) + ), + ] = None + http_headers: Annotated[ + Optional[List[HTTPHeader]], + Field( + alias="httpHeaders", + description=("Custom headers to set in the request. HTTP allows repeated headers."), + ), + ] = None + path: Annotated[Optional[str], Field(description="Path to access on the HTTP server.")] = None + port: Annotated[ + int, + Field( + description=( + "Name or number of the port to access on the container. Number must be" + " in the range 1 to 65535. Name must be an IANA_SVC_NAME." + ) + ), + ] + scheme: Annotated[ + Optional[Scheme], + Field( + description=( + "Scheme to use for connecting to the host. Defaults to" + ' HTTP.\n\nPossible enum values:\n - `"HTTP"` means that the scheme' + ' used will be http://\n - `"HTTPS"` means that the scheme used will be' + " https://" + ) + ), + ] = None -class Event(BaseModel): - action: Optional[str] = Field( - default=None, - description="What action was taken/failed regarding to the Regarding object.", - ) - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - count: Optional[int] = Field(default=None, description="The number of times this event has occurred.") - event_time: Optional[v1.MicroTime] = Field( - default=None, - alias="eventTime", - description="Time when this Event was first observed.", - ) - first_timestamp: Optional[v1.Time] = Field( - default=None, - alias="firstTimestamp", - description=("The time at which the event was first recorded. (Time of server receipt is" " in TypeMeta.)"), - ) - involved_object: ObjectReference = Field( - ..., alias="involvedObject", description="The object that this event is about." - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - last_timestamp: Optional[v1.Time] = Field( - default=None, - alias="lastTimestamp", - description=("The time at which the most recent occurrence of this event was recorded."), - ) - message: Optional[str] = Field( - default=None, - description="A human-readable description of the status of this operation.", - ) - metadata: v1.ObjectMeta = Field( - ..., - description=( - "Standard object's metadata. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - ), - ) - reason: Optional[str] = Field( - default=None, - description=( - "This should be a short, machine understandable string that gives the" - " reason for the transition into the object's current status." - ), - ) - related: Optional[ObjectReference] = Field( - default=None, description="Optional secondary object for more complex actions." - ) - reporting_component: Optional[str] = Field( - default=None, - alias="reportingComponent", - description=("Name of the controller that emitted this Event, e.g." " `kubernetes.io/kubelet`."), - ) - reporting_instance: Optional[str] = Field( - default=None, - alias="reportingInstance", - description="ID of the controller instance, e.g. `kubelet-xyzf`.", - ) - series: Optional[EventSeries] = Field( - default=None, - description=("Data about the Event series this event represents or nil if it's a" " singleton Event."), - ) - source: Optional[EventSource] = Field( - default=None, - description=("The component reporting this event. Should be a short machine" " understandable string."), - ) - type: Optional[str] = Field( - default=None, - description=("Type of this event (Normal, Warning), new types could be added in the" " future"), - ) +class NodeSelector(BaseModel): + node_selector_terms: Annotated[ + List[NodeSelectorTerm], + Field( + alias="nodeSelectorTerms", + description="Required. A list of node selector terms. The terms are ORed.", + ), + ] -class LifecycleHandler(BaseModel): - exec: Optional[ExecAction] = Field(default=None, description="Exec specifies the action to take.") - http_get: Optional[HTTPGetAction] = Field( - default=None, - alias="httpGet", - description="HTTPGet specifies the http request to perform.", - ) - tcp_socket: Optional[TCPSocketAction] = Field( - default=None, - alias="tcpSocket", - description=( - "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for" - " the backward compatibility. There are no validation of this field and" - " lifecycle hooks will fail in runtime when tcp handler is specified." - ), - ) +class PersistentVolumeClaimStatus(BaseModel): + access_modes: Annotated[ + Optional[List[str]], + Field( + alias="accessModes", + description=( + "AccessModes contains the actual access modes the volume backing the" + " PVC has. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1" + ), + ), + ] = None + allocated_resources: Annotated[ + Optional[Dict[str, resource.Quantity]], + Field( + alias="allocatedResources", + description=( + "The storage resource within AllocatedResources tracks the capacity" + " allocated to a PVC. It may be larger than the actual capacity when a" + " volume expansion operation is requested. For storage quota, the" + " larger value from allocatedResources and PVC.spec.resources is used." + " If allocatedResources is not set, PVC.spec.resources alone is used" + " for quota calculation. If a volume expansion capacity request is" + " lowered, allocatedResources is only lowered if there are no expansion" + " operations in progress and if the actual volume capacity is equal or" + " lower than the requested capacity. This is an alpha field and" + " requires enabling RecoverVolumeExpansionFailure feature." + ), + ), + ] = None + capacity: Annotated[ + Optional[Dict[str, resource.Quantity]], + Field(description="Represents the actual resources of the underlying volume."), + ] = None + conditions: Annotated[ + Optional[List[PersistentVolumeClaimCondition]], + Field( + description=( + "Current Condition of persistent volume claim. If underlying persistent" + " volume is being resized then the Condition will be set to" + " 'ResizeStarted'." + ) + ), + ] = None + phase: Annotated[ + Optional[Phase], + Field( + description=( + "Phase represents the current phase of" + ' PersistentVolumeClaim.\n\nPossible enum values:\n - `"Bound"` used' + ' for PersistentVolumeClaims that are bound\n - `"Lost"` used for' + " PersistentVolumeClaims that lost their underlying PersistentVolume." + " The claim was bound to a PersistentVolume and this volume does not" + ' exist any longer and all data on it was lost.\n - `"Pending"` used' + " for PersistentVolumeClaims that are not yet bound" + ) + ), + ] = None + resize_status: Annotated[ + Optional[str], + Field( + alias="resizeStatus", + description=( + "ResizeStatus stores status of resize operation. ResizeStatus is not" + " set by default but when expansion is complete resizeStatus is set to" + " empty string by resize controller or kubelet. This is an alpha field" + " and requires enabling RecoverVolumeExpansionFailure feature." + ), + ), + ] = None + + +class PodAffinityTerm(BaseModel): + label_selector: Annotated[ + Optional[v1.LabelSelector], + Field( + alias="labelSelector", + description="A label query over a set of resources, in this case pods.", + ), + ] = None + namespace_selector: Annotated[ + Optional[v1.LabelSelector], + Field( + alias="namespaceSelector", + description=( + "A label query over the set of namespaces that the term applies to. The" + " term is applied to the union of the namespaces selected by this field" + " and the ones listed in the namespaces field. null selector and null" + ' or empty namespaces list means "this pod\'s namespace". An empty' + " selector ({}) matches all namespaces. This field is beta-level and is" + " only honored when PodAffinityNamespaceSelector feature is enabled." + ), + ), + ] = None + namespaces: Annotated[ + Optional[List[str]], + Field( + description=( + "namespaces specifies a static list of namespace names that the term" + " applies to. The term is applied to the union of the namespaces listed" + " in this field and the ones selected by namespaceSelector. null or" + " empty namespaces list and null namespaceSelector means \"this pod's" + ' namespace"' + ) + ), + ] = None + topology_key: Annotated[ + str, + Field( + alias="topologyKey", + description=( + "This pod should be co-located (affinity) or not co-located" + " (anti-affinity) with the pods matching the labelSelector in the" + " specified namespaces, where co-located is defined as running on a" + " node whose value of the label with key topologyKey matches that of" + " any node on which any of the selected pods is running. Empty" + " topologyKey is not allowed." + ), + ), + ] class NodeAffinity(BaseModel): - preferred_during_scheduling_ignored_during_execution: Optional[List[PreferredSchedulingTerm]] = Field( - default=None, - alias="preferredDuringSchedulingIgnoredDuringExecution", - description=( - "The scheduler will prefer to schedule pods to nodes that satisfy the" - " affinity expressions specified by this field, but it may choose a node" - " that violates one or more of the expressions. The node that is most" - " preferred is the one with the greatest sum of weights, i.e. for each node" - " that meets all of the scheduling requirements (resource request," - " requiredDuringScheduling affinity expressions, etc.), compute a sum by" - ' iterating through the elements of this field and adding "weight" to the' - " sum if the node matches the corresponding matchExpressions; the node(s)" - " with the highest sum are the most preferred." - ), - ) - required_during_scheduling_ignored_during_execution: Optional[NodeSelector] = Field( - default=None, - alias="requiredDuringSchedulingIgnoredDuringExecution", - description=( - "If the affinity requirements specified by this field are not met at" - " scheduling time, the pod will not be scheduled onto the node. If the" - " affinity requirements specified by this field cease to be met at some" - " point during pod execution (e.g. due to an update), the system may or may" - " not try to eventually evict the pod from its node." - ), - ) + preferred_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[PreferredSchedulingTerm]], + Field( + alias="preferredDuringSchedulingIgnoredDuringExecution", + description=( + "The scheduler will prefer to schedule pods to nodes that satisfy the" + " affinity expressions specified by this field, but it may choose a" + " node that violates one or more of the expressions. The node that is" + " most preferred is the one with the greatest sum of weights, i.e. for" + " each node that meets all of the scheduling requirements (resource" + " request, requiredDuringScheduling affinity expressions, etc.)," + " compute a sum by iterating through the elements of this field and" + ' adding "weight" to the sum if the node matches the corresponding' + " matchExpressions; the node(s) with the highest sum are the most" + " preferred." + ), + ), + ] = None + required_during_scheduling_ignored_during_execution: Annotated[ + Optional[NodeSelector], + Field( + alias="requiredDuringSchedulingIgnoredDuringExecution", + description=( + "If the affinity requirements specified by this field are not met at" + " scheduling time, the pod will not be scheduled onto the node. If the" + " affinity requirements specified by this field cease to be met at some" + " point during pod execution (e.g. due to an update), the system may or" + " may not try to eventually evict the pod from its node." + ), + ), + ] = None class PersistentVolumeClaimSpec(BaseModel): - access_modes: Optional[List[str]] = Field( - default=None, - alias="accessModes", - description=( - "AccessModes contains the desired access modes the volume should have. More" - " info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1" - ), - ) - data_source: Optional[TypedLocalObjectReference] = Field( - default=None, - alias="dataSource", - description=( - "This field can be used to specify either: * An existing VolumeSnapshot" - " object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC" - " (PersistentVolumeClaim) If the provisioner or an external controller can" - " support the specified data source, it will create a new volume based on" - " the contents of the specified data source. If the AnyVolumeDataSource" - " feature gate is enabled, this field will always have the same contents as" - " the DataSourceRef field." - ), - ) - data_source_ref: Optional[TypedLocalObjectReference] = Field( - default=None, - alias="dataSourceRef", - description=( - "Specifies the object from which to populate the volume with data, if a" - " non-empty volume is desired. This may be any local object from a" - " non-empty API group (non core object) or a PersistentVolumeClaim object." - " When this field is specified, volume binding will only succeed if the" - " type of the specified object matches some installed volume populator or" - " dynamic provisioner. This field will replace the functionality of the" - " DataSource field and as such if both fields are non-empty, they must have" - " the same value. For backwards compatibility, both fields (DataSource and" - " DataSourceRef) will be set to the same value automatically if one of them" - " is empty and the other is non-empty. There are two important differences" - " between DataSource and DataSourceRef: * While DataSource only allows two" - " specific types of objects, DataSourceRef\n allows any non-core object," - " as well as PersistentVolumeClaim objects.\n* While DataSource ignores" - " disallowed values (dropping them), DataSourceRef\n preserves all values," - " and generates an error if a disallowed value is\n specified.\n(Alpha)" - " Using this field requires the AnyVolumeDataSource feature gate to be" - " enabled." - ), - ) - resources: Optional[ResourceRequirements] = Field( - default=None, - description=( - "Resources represents the minimum resources the volume should have. If" - " RecoverVolumeExpansionFailure feature is enabled users are allowed to" - " specify resource requirements that are lower than previous value but must" - " still be higher than capacity recorded in the status field of the claim." - " More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources" - ), - ) - selector: Optional[v1.LabelSelector] = Field( - default=None, description="A label query over volumes to consider for binding." - ) - storage_class_name: Optional[str] = Field( - default=None, - alias="storageClassName", - description=( - "Name of the StorageClass required by the claim. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1" - ), - ) - volume_mode: Optional[str] = Field( - default=None, - alias="volumeMode", - description=( - "volumeMode defines what type of volume is required by the claim. Value of" - " Filesystem is implied when not included in claim spec." - ), - ) - volume_name: Optional[str] = Field( - default=None, - alias="volumeName", - description=("VolumeName is the binding reference to the PersistentVolume backing this" " claim."), - ) + access_modes: Annotated[ + Optional[List[str]], + Field( + alias="accessModes", + description=( + "AccessModes contains the desired access modes the volume should have." + " More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1" + ), + ), + ] = None + data_source: Annotated[ + Optional[TypedLocalObjectReference], + Field( + alias="dataSource", + description=( + "This field can be used to specify either: * An existing VolumeSnapshot" + " object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC" + " (PersistentVolumeClaim) If the provisioner or an external controller" + " can support the specified data source, it will create a new volume" + " based on the contents of the specified data source. If the" + " AnyVolumeDataSource feature gate is enabled, this field will always" + " have the same contents as the DataSourceRef field." + ), + ), + ] = None + data_source_ref: Annotated[ + Optional[TypedLocalObjectReference], + Field( + alias="dataSourceRef", + description=( + "Specifies the object from which to populate the volume with data, if a" + " non-empty volume is desired. This may be any local object from a" + " non-empty API group (non core object) or a PersistentVolumeClaim" + " object. When this field is specified, volume binding will only" + " succeed if the type of the specified object matches some installed" + " volume populator or dynamic provisioner. This field will replace the" + " functionality of the DataSource field and as such if both fields are" + " non-empty, they must have the same value. For backwards" + " compatibility, both fields (DataSource and DataSourceRef) will be set" + " to the same value automatically if one of them is empty and the other" + " is non-empty. There are two important differences between DataSource" + " and DataSourceRef: * While DataSource only allows two specific types" + " of objects, DataSourceRef\n allows any non-core object, as well as" + " PersistentVolumeClaim objects.\n* While DataSource ignores disallowed" + " values (dropping them), DataSourceRef\n preserves all values, and" + " generates an error if a disallowed value is\n specified.\n(Alpha)" + " Using this field requires the AnyVolumeDataSource feature gate to be" + " enabled." + ), + ), + ] = None + resources: Annotated[ + Optional[ResourceRequirements], + Field( + description=( + "Resources represents the minimum resources the volume should have. If" + " RecoverVolumeExpansionFailure feature is enabled users are allowed to" + " specify resource requirements that are lower than previous value but" + " must still be higher than capacity recorded in the status field of" + " the claim. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources" + ) + ), + ] = None + selector: Annotated[ + Optional[v1.LabelSelector], + Field(description="A label query over volumes to consider for binding."), + ] = None + storage_class_name: Annotated[ + Optional[str], + Field( + alias="storageClassName", + description=( + "Name of the StorageClass required by the claim. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1" + ), + ), + ] = None + volume_mode: Annotated[ + Optional[str], + Field( + alias="volumeMode", + description=( + "volumeMode defines what type of volume is required by the claim. Value" + " of Filesystem is implied when not included in claim spec." + ), + ), + ] = None + volume_name: Annotated[ + Optional[str], + Field( + alias="volumeName", + description=("VolumeName is the binding reference to the PersistentVolume backing" " this claim."), + ), + ] = None -class PersistentVolumeClaimTemplate(BaseModel): - metadata: Optional[v1.ObjectMeta] = Field( - default=None, - description=( - "May contain labels and annotations that will be copied into the PVC when" - " creating it. No other fields are allowed and will be rejected during" - " validation." - ), - ) - spec: PersistentVolumeClaimSpec = Field( - ..., - description=( - "The specification for the PersistentVolumeClaim. The entire content is" - " copied unchanged into the PVC that gets created from this template. The" - " same fields as in a PersistentVolumeClaim are also valid here." - ), - ) +class VolumeProjection(BaseModel): + config_map: Annotated[ + Optional[ConfigMapProjection], + Field( + alias="configMap", + description="information about the configMap data to project", + ), + ] = None + downward_api: Annotated[ + Optional[DownwardAPIProjection], + Field( + alias="downwardAPI", + description="information about the downwardAPI data to project", + ), + ] = None + secret: Annotated[ + Optional[SecretProjection], + Field(description="information about the secret data to project"), + ] = None + service_account_token: Annotated[ + Optional[ServiceAccountTokenProjection], + Field( + alias="serviceAccountToken", + description="information about the serviceAccountToken data to project", + ), + ] = None -class PodAffinityTerm(BaseModel): - label_selector: Optional[v1.LabelSelector] = Field( - default=None, - alias="labelSelector", - description="A label query over a set of resources, in this case pods.", - ) - namespace_selector: Optional[v1.LabelSelector] = Field( - default=None, - alias="namespaceSelector", - description=( - "A label query over the set of namespaces that the term applies to. The" - " term is applied to the union of the namespaces selected by this field and" - " the ones listed in the namespaces field. null selector and null or empty" - ' namespaces list means "this pod\'s namespace". An empty selector ({})' - " matches all namespaces. This field is beta-level and is only honored when" - " PodAffinityNamespaceSelector feature is enabled." - ), - ) - namespaces: Optional[List[str]] = Field( - default=None, - description=( - "namespaces specifies a static list of namespace names that the term" - " applies to. The term is applied to the union of the namespaces listed in" - " this field and the ones selected by namespaceSelector. null or empty" - ' namespaces list and null namespaceSelector means "this pod\'s namespace"' - ), - ) - topology_key: str = Field( - ..., - alias="topologyKey", - description=( - "This pod should be co-located (affinity) or not co-located (anti-affinity)" - " with the pods matching the labelSelector in the specified namespaces," - " where co-located is defined as running on a node whose value of the label" - " with key topologyKey matches that of any node on which any of the" - " selected pods is running. Empty topologyKey is not allowed." - ), - ) +class LifecycleHandler(BaseModel): + exec: Annotated[Optional[ExecAction], Field(description="Exec specifies the action to take.")] = None + http_get: Annotated[ + Optional[HTTPGetAction], + Field( + alias="httpGet", + description="HTTPGet specifies the http request to perform.", + ), + ] = None + tcp_socket: Annotated[ + Optional[TCPSocketAction], + Field( + alias="tcpSocket", + description=( + "Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept" + " for the backward compatibility. There are no validation of this field" + " and lifecycle hooks will fail in runtime when tcp handler is" + " specified." + ), + ), + ] = None class Probe(BaseModel): - exec: Optional[ExecAction] = Field(default=None, description="Exec specifies the action to take.") - failure_threshold: Optional[int] = Field( - default=None, - alias="failureThreshold", - description=( - "Minimum consecutive failures for the probe to be considered failed after" - " having succeeded. Defaults to 3. Minimum value is 1." - ), - ) - grpc: Optional[GRPCAction] = Field( - default=None, - description=( - "GRPC specifies an action involving a GRPC port. This is an alpha field and" - " requires enabling GRPCContainerProbe feature gate." - ), - ) - http_get: Optional[HTTPGetAction] = Field( - default=None, - alias="httpGet", - description="HTTPGet specifies the http request to perform.", - ) - initial_delay_seconds: Optional[int] = Field( - default=None, - alias="initialDelaySeconds", - description=( - "Number of seconds after the container has started before liveness probes" - " are initiated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - period_seconds: Optional[int] = Field( - default=None, - alias="periodSeconds", - description=("How often (in seconds) to perform the probe. Default to 10 seconds." " Minimum value is 1."), - ) - success_threshold: Optional[int] = Field( - default=None, - alias="successThreshold", - description=( - "Minimum consecutive successes for the probe to be considered successful" - " after having failed. Defaults to 1. Must be 1 for liveness and startup." - " Minimum value is 1." - ), - ) - tcp_socket: Optional[TCPSocketAction] = Field( - default=None, - alias="tcpSocket", - description="TCPSocket specifies an action involving a TCP port.", - ) - termination_grace_period_seconds: Optional[int] = Field( - default=None, - alias="terminationGracePeriodSeconds", - description=( - "Optional duration in seconds the pod needs to terminate gracefully upon" - " probe failure. The grace period is the duration in seconds after the" - " processes running in the pod are sent a termination signal and the time" - " when the processes are forcibly halted with a kill signal. Set this value" - " longer than the expected cleanup time for your process. If this value is" - " nil, the pod's terminationGracePeriodSeconds will be used. Otherwise," - " this value overrides the value provided by the pod spec. Value must be" - " non-negative integer. The value zero indicates stop immediately via the" - " kill signal (no opportunity to shut down). This is a beta field and" - " requires enabling ProbeTerminationGracePeriod feature gate. Minimum value" - " is 1. spec.terminationGracePeriodSeconds is used if unset." - ), - ) - timeout_seconds: Optional[int] = Field( - default=None, - alias="timeoutSeconds", - description=( - "Number of seconds after which the probe times out. Defaults to 1 second." - " Minimum value is 1. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) + exec: Annotated[Optional[ExecAction], Field(description="Exec specifies the action to take.")] = None + failure_threshold: Annotated[ + Optional[int], + Field( + alias="failureThreshold", + description=( + "Minimum consecutive failures for the probe to be considered failed" + " after having succeeded. Defaults to 3. Minimum value is 1." + ), + ), + ] = None + grpc: Annotated[ + Optional[GRPCAction], + Field( + description=( + "GRPC specifies an action involving a GRPC port. This is an alpha field" + " and requires enabling GRPCContainerProbe feature gate." + ) + ), + ] = None + http_get: Annotated[ + Optional[HTTPGetAction], + Field( + alias="httpGet", + description="HTTPGet specifies the http request to perform.", + ), + ] = None + initial_delay_seconds: Annotated[ + Optional[int], + Field( + alias="initialDelaySeconds", + description=( + "Number of seconds after the container has started before liveness" + " probes are initiated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + period_seconds: Annotated[ + Optional[int], + Field( + alias="periodSeconds", + description=("How often (in seconds) to perform the probe. Default to 10 seconds." " Minimum value is 1."), + ), + ] = None + success_threshold: Annotated[ + Optional[int], + Field( + alias="successThreshold", + description=( + "Minimum consecutive successes for the probe to be considered" + " successful after having failed. Defaults to 1. Must be 1 for liveness" + " and startup. Minimum value is 1." + ), + ), + ] = None + tcp_socket: Annotated[ + Optional[TCPSocketAction], + Field( + alias="tcpSocket", + description="TCPSocket specifies an action involving a TCP port.", + ), + ] = None + termination_grace_period_seconds: Annotated[ + Optional[int], + Field( + alias="terminationGracePeriodSeconds", + description=( + "Optional duration in seconds the pod needs to terminate gracefully" + " upon probe failure. The grace period is the duration in seconds after" + " the processes running in the pod are sent a termination signal and" + " the time when the processes are forcibly halted with a kill signal." + " Set this value longer than the expected cleanup time for your" + " process. If this value is nil, the pod's" + " terminationGracePeriodSeconds will be used. Otherwise, this value" + " overrides the value provided by the pod spec. Value must be" + " non-negative integer. The value zero indicates stop immediately via" + " the kill signal (no opportunity to shut down). This is a beta field" + " and requires enabling ProbeTerminationGracePeriod feature gate." + " Minimum value is 1. spec.terminationGracePeriodSeconds is used if" + " unset." + ), + ), + ] = None + timeout_seconds: Annotated[ + Optional[int], + Field( + alias="timeoutSeconds", + description=( + "Number of seconds after which the probe times out. Defaults to 1" + " second. Minimum value is 1. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None class WeightedPodAffinityTerm(BaseModel): - pod_affinity_term: PodAffinityTerm = Field( - ..., - alias="podAffinityTerm", - description=("Required. A pod affinity term, associated with the corresponding weight."), - ) - weight: int = Field( - ..., - description=("weight associated with matching the corresponding podAffinityTerm, in the" " range 1-100."), - ) + pod_affinity_term: Annotated[ + PodAffinityTerm, + Field( + alias="podAffinityTerm", + description=("Required. A pod affinity term, associated with the corresponding" " weight."), + ), + ] + weight: Annotated[ + int, + Field( + description=("weight associated with matching the corresponding podAffinityTerm, in" " the range 1-100.") + ), + ] -class DownwardAPIProjection(BaseModel): - items: Optional[List[DownwardAPIVolumeFile]] = Field( - default=None, description="Items is a list of DownwardAPIVolume file" - ) +class Event(BaseModel): + action: Annotated[ + Optional[str], + Field(description=("What action was taken/failed regarding to the Regarding object.")), + ] = None + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + count: Annotated[Optional[int], Field(description="The number of times this event has occurred.")] = None + event_time: Annotated[ + Optional[v1.MicroTime], + Field(alias="eventTime", description="Time when this Event was first observed."), + ] = None + first_timestamp: Annotated[ + Optional[v1.Time], + Field( + alias="firstTimestamp", + description=( + "The time at which the event was first recorded. (Time of server" " receipt is in TypeMeta.)" + ), + ), + ] = None + involved_object: Annotated[ + ObjectReference, + Field(alias="involvedObject", description="The object that this event is about."), + ] + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + last_timestamp: Annotated[ + Optional[v1.Time], + Field( + alias="lastTimestamp", + description=("The time at which the most recent occurrence of this event was" " recorded."), + ), + ] = None + message: Annotated[ + Optional[str], + Field(description="A human-readable description of the status of this operation."), + ] = None + metadata: Annotated[ + v1.ObjectMeta, + Field( + description=( + "Standard object's metadata. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + ) + ), + ] + reason: Annotated[ + Optional[str], + Field( + description=( + "This should be a short, machine understandable string that gives the" + " reason for the transition into the object's current status." + ) + ), + ] = None + related: Annotated[ + Optional[ObjectReference], + Field(description="Optional secondary object for more complex actions."), + ] = None + reporting_component: Annotated[ + Optional[str], + Field( + alias="reportingComponent", + description=("Name of the controller that emitted this Event, e.g." " `kubernetes.io/kubelet`."), + ), + ] = None + reporting_instance: Annotated[ + Optional[str], + Field( + alias="reportingInstance", + description="ID of the controller instance, e.g. `kubelet-xyzf`.", + ), + ] = None + series: Annotated[ + Optional[EventSeries], + Field(description=("Data about the Event series this event represents or nil if it's a" " singleton Event.")), + ] = None + source: Annotated[ + Optional[EventSource], + Field(description=("The component reporting this event. Should be a short machine" " understandable string.")), + ] = None + type: Annotated[ + Optional[str], + Field(description=("Type of this event (Normal, Warning), new types could be added in the" " future")), + ] = None -class EnvVar(BaseModel): - name: str = Field(..., description="Name of the environment variable. Must be a C_IDENTIFIER.") - value: Optional[str] = Field( - default=None, - description=( - "Variable references $(VAR_NAME) are expanded using the previously defined" - " environment variables in the container and any service environment" - " variables. If a variable cannot be resolved, the reference in the input" - " string will be unchanged. Double $$ are reduced to a single $, which" - ' allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will' - ' produce the string literal "$(VAR_NAME)". Escaped references will never' - " be expanded, regardless of whether the variable exists or not. Defaults" - ' to "".' - ), - ) - value_from: Optional[EnvVarSource] = Field( - default=None, - alias="valueFrom", - description=("Source for the environment variable's value. Cannot be used if value is" " not empty."), - ) +class PersistentVolumeClaim(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the versioned schema of this representation of an" + " object. Servers should convert recognized schemas to the latest" + " internal value, and may reject unrecognized values. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" + ), + ), + ] = None + kind: Annotated[ + Optional[str], + Field( + description=( + "Kind is a string value representing the REST resource this object" + " represents. Servers may infer this from the endpoint the client" + " submits requests to. Cannot be updated. In CamelCase. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] = None + metadata: Annotated[ + Optional[v1.ObjectMeta], + Field( + description=( + "Standard object's metadata. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + ) + ), + ] = None + spec: Annotated[ + Optional[PersistentVolumeClaimSpec], + Field( + description=( + "Spec defines the desired characteristics of a volume requested by a" + " pod author. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" + ) + ), + ] = None + status: Annotated[ + Optional[PersistentVolumeClaimStatus], + Field( + description=( + "Status represents the current information/status of a persistent" + " volume claim. Read-only. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" + ) + ), + ] = None -class EphemeralVolumeSource(BaseModel): - volume_claim_template: Optional[PersistentVolumeClaimTemplate] = Field( - default=None, - alias="volumeClaimTemplate", - description=( - "Will be used to create a stand-alone PVC to provision the volume. The pod" - " in which this EphemeralVolumeSource is embedded will be the owner of the" - " PVC, i.e. the PVC will be deleted together with the pod. The name of the" - " PVC will be `-` where `` is the name" - " from the `PodSpec.Volumes` array entry. Pod validation will reject the" - " pod if the concatenated name is not valid for a PVC (for example, too" - " long).\n\nAn existing PVC with that name that is not owned by the pod" - " will *not* be used for the pod to avoid using an unrelated volume by" - " mistake. Starting the pod is then blocked until the unrelated PVC is" - " removed. If such a pre-created PVC is meant to be used by the pod, the" - " PVC has to updated with an owner reference to the pod once the pod" - " exists. Normally this should not be necessary, but it may be useful when" - " manually reconstructing a broken cluster.\n\nThis field is read-only and" - " no changes will be made by Kubernetes to the PVC after it has been" - " created.\n\nRequired, must not be nil." - ), - ) +class PersistentVolumeClaimTemplate(BaseModel): + metadata: Annotated[ + Optional[v1.ObjectMeta], + Field( + description=( + "May contain labels and annotations that will be copied into the PVC" + " when creating it. No other fields are allowed and will be rejected" + " during validation." + ) + ), + ] = None + spec: Annotated[ + PersistentVolumeClaimSpec, + Field( + description=( + "The specification for the PersistentVolumeClaim. The entire content is" + " copied unchanged into the PVC that gets created from this template." + " The same fields as in a PersistentVolumeClaim are also valid here." + ) + ), + ] class Lifecycle(BaseModel): - post_start: Optional[LifecycleHandler] = Field( - default=None, - alias="postStart", - description=( - "PostStart is called immediately after a container is created. If the" - " handler fails, the container is terminated and restarted according to its" - " restart policy. Other management of the container blocks until the hook" - " completes. More info:" - " https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" - ), - ) - pre_stop: Optional[LifecycleHandler] = Field( - default=None, - alias="preStop", - description=( - "PreStop is called immediately before a container is terminated due to an" - " API request or management event such as liveness/startup probe failure," - " preemption, resource contention, etc. The handler is not called if the" - " container crashes or exits. The Pod's termination grace period countdown" - " begins before the PreStop hook is executed. Regardless of the outcome of" - " the handler, the container will eventually terminate within the Pod's" - " termination grace period (unless delayed by finalizers). Other management" - " of the container blocks until the hook completes or until the termination" - " grace period is reached. More info:" - " https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" - ), - ) + post_start: Annotated[ + Optional[LifecycleHandler], + Field( + alias="postStart", + description=( + "PostStart is called immediately after a container is created. If the" + " handler fails, the container is terminated and restarted according to" + " its restart policy. Other management of the container blocks until" + " the hook completes. More info:" + " https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" + ), + ), + ] = None + pre_stop: Annotated[ + Optional[LifecycleHandler], + Field( + alias="preStop", + description=( + "PreStop is called immediately before a container is terminated due to" + " an API request or management event such as liveness/startup probe" + " failure, preemption, resource contention, etc. The handler is not" + " called if the container crashes or exits. The Pod's termination grace" + " period countdown begins before the PreStop hook is executed." + " Regardless of the outcome of the handler, the container will" + " eventually terminate within the Pod's termination grace period" + " (unless delayed by finalizers). Other management of the container" + " blocks until the hook completes or until the termination grace period" + " is reached. More info:" + " https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" + ), + ), + ] = None -class PersistentVolumeClaim(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the versioned schema of this representation of an" - " object. Servers should convert recognized schemas to the latest internal" - " value, and may reject unrecognized values. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources" - ), - ) - kind: Optional[str] = Field( - default=None, - description=( - "Kind is a string value representing the REST resource this object" - " represents. Servers may infer this from the endpoint the client submits" - " requests to. Cannot be updated. In CamelCase. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - metadata: Optional[v1.ObjectMeta] = Field( - default=None, - description=( - "Standard object's metadata. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - ), - ) - spec: Optional[PersistentVolumeClaimSpec] = Field( - default=None, - description=( - "Spec defines the desired characteristics of a volume requested by a pod" - " author. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - ), - ) - status: Optional[PersistentVolumeClaimStatus] = Field( - default=None, - description=( - "Status represents the current information/status of a persistent volume" - " claim. Read-only. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - ), - ) +class EphemeralVolumeSource(BaseModel): + volume_claim_template: Annotated[ + Optional[PersistentVolumeClaimTemplate], + Field( + alias="volumeClaimTemplate", + description=( + "Will be used to create a stand-alone PVC to provision the volume. The" + " pod in which this EphemeralVolumeSource is embedded will be the owner" + " of the PVC, i.e. the PVC will be deleted together with the pod. The" + " name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod" + " validation will reject the pod if the concatenated name is not valid" + " for a PVC (for example, too long).\n\nAn existing PVC with that name" + " that is not owned by the pod will *not* be used for the pod to avoid" + " using an unrelated volume by mistake. Starting the pod is then" + " blocked until the unrelated PVC is removed. If such a pre-created PVC" + " is meant to be used by the pod, the PVC has to updated with an owner" + " reference to the pod once the pod exists. Normally this should not be" + " necessary, but it may be useful when manually reconstructing a broken" + " cluster.\n\nThis field is read-only and no changes will be made by" + " Kubernetes to the PVC after it has been created.\n\nRequired, must" + " not be nil." + ), + ), + ] = None + + +class Container(BaseModel): + args: Annotated[ + Optional[List[str]], + Field( + description=( + "Arguments to the entrypoint. The docker image's CMD is used if this" + " is not provided. Variable references $(VAR_NAME) are expanded using" + " the container's environment. If a variable cannot be resolved, the" + " reference in the input string will be unchanged. Double $$ are" + " reduced to a single $, which allows for escaping the $(VAR_NAME)" + ' syntax: i.e. "$$(VAR_NAME)" will produce the string literal' + ' "$(VAR_NAME)". Escaped references will never be expanded, regardless' + " of whether the variable exists or not. Cannot be updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + command: Annotated[ + Optional[List[str]], + Field( + description=( + "Entrypoint array. Not executed within a shell. The docker image's" + " ENTRYPOINT is used if this is not provided. Variable references" + " $(VAR_NAME) are expanded using the container's environment. If a" + " variable cannot be resolved, the reference in the input string will" + " be unchanged. Double $$ are reduced to a single $, which allows for" + ' escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the' + ' string literal "$(VAR_NAME)". Escaped references will never be' + " expanded, regardless of whether the variable exists or not. Cannot be" + " updated. More info:" + " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" + ) + ), + ] = None + env: Annotated[ + Optional[List[EnvVar]], + Field(description=("List of environment variables to set in the container. Cannot be" " updated.")), + ] = None + env_from: Annotated[ + Optional[List[EnvFromSource]], + Field( + alias="envFrom", + description=( + "List of sources to populate environment variables in the container." + " The keys defined within a source must be a C_IDENTIFIER. All invalid" + " keys will be reported as an event when the container is starting." + " When a key exists in multiple sources, the value associated with the" + " last source will take precedence. Values defined by an Env with a" + " duplicate key will take precedence. Cannot be updated." + ), + ), + ] = None + image: Annotated[ + str, + Field( + description=( + "Docker image name. More info:" + " https://kubernetes.io/docs/concepts/containers/images This field is" + " optional to allow higher level config management to default or" + " override container images in workload controllers like Deployments" + " and StatefulSets." + ) + ), + ] + image_pull_policy: Annotated[ + Optional[str], + Field( + alias="imagePullPolicy", + description=( + "Image pull policy. One of Always, Never, IfNotPresent. Defaults to" + " Always if :latest tag is specified, or IfNotPresent otherwise. Cannot" + " be updated. More info:" + " https://kubernetes.io/docs/concepts/containers/images#updating-images\n\nPossible" + ' enum values:\n - `"Always"` means that kubelet always attempts to' + " pull the latest image. Container will fail If the pull fails.\n -" + ' `"IfNotPresent"` means that kubelet pulls if the image isn\'t present' + " on disk. Container will fail if the image isn't present and the pull" + ' fails.\n - `"Never"` means that kubelet never pulls an image, but' + " only uses a local image. Container will fail if the image isn't" + " present" + ), + ), + ] = None + lifecycle: Annotated[ + Optional[Lifecycle], + Field( + description=( + "Actions that the management system should take in response to" + " container lifecycle events. Cannot be updated." + ) + ), + ] = None + liveness_probe: Annotated[ + Optional[Probe], + Field( + alias="livenessProbe", + description=( + "Periodic probe of container liveness. Container will be restarted if" + " the probe fails. Cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name of the container specified as a DNS_LABEL. Each container in a" + " pod must have a unique name (DNS_LABEL). Cannot be updated." + ) + ), + ] = None + ports: Annotated[ + Optional[List[ContainerPort]], + Field( + description=( + "List of ports to expose from the container. Exposing a port here gives" + " the system additional information about the network connections a" + " container uses, but is primarily informational. Not specifying a port" + " here DOES NOT prevent that port from being exposed. Any port which is" + ' listening on the default "0.0.0.0" address inside a container will be' + " accessible from the network. Cannot be updated." + ) + ), + ] = None + readiness_probe: Annotated[ + Optional[Probe], + Field( + alias="readinessProbe", + description=( + "Periodic probe of container service readiness. Container will be" + " removed from service endpoints if the probe fails. Cannot be updated." + " More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + resources: Annotated[ + Optional[ResourceRequirements], + Field( + description=( + "Compute Resources required by this container. Cannot be updated. More" + " info:" + " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" + ) + ), + ] = None + security_context: Annotated[ + Optional[SecurityContext], + Field( + alias="securityContext", + description=( + "SecurityContext defines the security options the container should be" + " run with. If set, the fields of SecurityContext override the" + " equivalent fields of PodSecurityContext. More info:" + " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" + ), + ), + ] = None + startup_probe: Annotated[ + Optional[Probe], + Field( + alias="startupProbe", + description=( + "StartupProbe indicates that the Pod has successfully initialized. If" + " specified, no other probes are executed until this completes" + " successfully. If this probe fails, the Pod will be restarted, just as" + " if the livenessProbe failed. This can be used to provide different" + " probe parameters at the beginning of a Pod's lifecycle, when it might" + " take a long time to load data or warm a cache, than during" + " steady-state operation. This cannot be updated. More info:" + " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" + ), + ), + ] = None + stdin: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a buffer for stdin in the" + " container runtime. If this is not set, reads from stdin in the" + " container will always result in EOF. Default is false." + ) + ), + ] = None + stdin_once: Annotated[ + Optional[bool], + Field( + alias="stdinOnce", + description=( + "Whether the container runtime should close the stdin channel after it" + " has been opened by a single attach. When stdin is true the stdin" + " stream will remain open across multiple attach sessions. If stdinOnce" + " is set to true, stdin is opened on container start, is empty until" + " the first client attaches to stdin, and then remains open and accepts" + " data until the client disconnects, at which time stdin is closed and" + " remains closed until the container is restarted. If this flag is" + " false, a container processes that reads from stdin will never receive" + " an EOF. Default is false" + ), + ), + ] = None + termination_message_path: Annotated[ + Optional[str], + Field( + alias="terminationMessagePath", + description=( + "Optional: Path at which the file to which the container's termination" + " message will be written is mounted into the container's filesystem." + " Message written is intended to be brief final status, such as an" + " assertion failure message. Will be truncated by the node if greater" + " than 4096 bytes. The total message length across all containers will" + " be limited to 12kb. Defaults to /dev/termination-log. Cannot be" + " updated." + ), + ), + ] = None + termination_message_policy: Annotated[ + Optional[TerminationMessagePolicy], + Field( + alias="terminationMessagePolicy", + description=( + "Indicate how the termination message should be populated. File will" + " use the contents of terminationMessagePath to populate the container" + " status message on both success and failure. FallbackToLogsOnError" + " will use the last chunk of container log output if the termination" + " message file is empty and the container exited with an error. The log" + " output is limited to 2048 bytes or 80 lines, whichever is smaller." + " Defaults to File. Cannot be updated.\n\nPossible enum values:\n -" + ' `"FallbackToLogsOnError"` will read the most recent contents of the' + " container logs for the container status message when the container" + " exits with an error and the terminationMessagePath has no contents.\n" + ' - `"File"` is the default behavior and will set the container status' + " message to the contents of the container's terminationMessagePath" + " when the container exits." + ), + ), + ] = None + tty: Annotated[ + Optional[bool], + Field( + description=( + "Whether this container should allocate a TTY for itself, also requires" + " 'stdin' to be true. Default is false." + ) + ), + ] = None + volume_devices: Annotated[ + Optional[List[VolumeDevice]], + Field( + alias="volumeDevices", + description=("volumeDevices is the list of block devices to be used by the" " container."), + ), + ] = None + volume_mounts: Annotated[ + Optional[List[VolumeMount]], + Field( + alias="volumeMounts", + description=("Pod volumes to mount into the container's filesystem. Cannot be" " updated."), + ), + ] = None + working_dir: Annotated[ + Optional[str], + Field( + alias="workingDir", + description=( + "Container's working directory. If not specified, the container" + " runtime's default will be used, which might be configured in the" + " container image. Cannot be updated." + ), + ), + ] = None class PodAffinity(BaseModel): - preferred_during_scheduling_ignored_during_execution: Optional[List[WeightedPodAffinityTerm]] = Field( - default=None, - alias="preferredDuringSchedulingIgnoredDuringExecution", - description=( - "The scheduler will prefer to schedule pods to nodes that satisfy the" - " affinity expressions specified by this field, but it may choose a node" - " that violates one or more of the expressions. The node that is most" - " preferred is the one with the greatest sum of weights, i.e. for each node" - " that meets all of the scheduling requirements (resource request," - " requiredDuringScheduling affinity expressions, etc.), compute a sum by" - ' iterating through the elements of this field and adding "weight" to the' - " sum if the node has pods which matches the corresponding podAffinityTerm;" - " the node(s) with the highest sum are the most preferred." - ), - ) - required_during_scheduling_ignored_during_execution: Optional[List[PodAffinityTerm]] = Field( - default=None, - alias="requiredDuringSchedulingIgnoredDuringExecution", - description=( - "If the affinity requirements specified by this field are not met at" - " scheduling time, the pod will not be scheduled onto the node. If the" - " affinity requirements specified by this field cease to be met at some" - " point during pod execution (e.g. due to a pod label update), the system" - " may or may not try to eventually evict the pod from its node. When there" - " are multiple elements, the lists of nodes corresponding to each" - " podAffinityTerm are intersected, i.e. all terms must be satisfied." - ), - ) + preferred_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[WeightedPodAffinityTerm]], + Field( + alias="preferredDuringSchedulingIgnoredDuringExecution", + description=( + "The scheduler will prefer to schedule pods to nodes that satisfy the" + " affinity expressions specified by this field, but it may choose a" + " node that violates one or more of the expressions. The node that is" + " most preferred is the one with the greatest sum of weights, i.e. for" + " each node that meets all of the scheduling requirements (resource" + " request, requiredDuringScheduling affinity expressions, etc.)," + " compute a sum by iterating through the elements of this field and" + ' adding "weight" to the sum if the node has pods which matches the' + " corresponding podAffinityTerm; the node(s) with the highest sum are" + " the most preferred." + ), + ), + ] = None + required_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[PodAffinityTerm]], + Field( + alias="requiredDuringSchedulingIgnoredDuringExecution", + description=( + "If the affinity requirements specified by this field are not met at" + " scheduling time, the pod will not be scheduled onto the node. If the" + " affinity requirements specified by this field cease to be met at some" + " point during pod execution (e.g. due to a pod label update), the" + " system may or may not try to eventually evict the pod from its node." + " When there are multiple elements, the lists of nodes corresponding to" + " each podAffinityTerm are intersected, i.e. all terms must be" + " satisfied." + ), + ), + ] = None class PodAntiAffinity(BaseModel): - preferred_during_scheduling_ignored_during_execution: Optional[List[WeightedPodAffinityTerm]] = Field( - default=None, - alias="preferredDuringSchedulingIgnoredDuringExecution", - description=( - "The scheduler will prefer to schedule pods to nodes that satisfy the" - " anti-affinity expressions specified by this field, but it may choose a" - " node that violates one or more of the expressions. The node that is most" - " preferred is the one with the greatest sum of weights, i.e. for each node" - " that meets all of the scheduling requirements (resource request," - " requiredDuringScheduling anti-affinity expressions, etc.), compute a sum" - ' by iterating through the elements of this field and adding "weight" to' - " the sum if the node has pods which matches the corresponding" - " podAffinityTerm; the node(s) with the highest sum are the most preferred." - ), - ) - required_during_scheduling_ignored_during_execution: Optional[List[PodAffinityTerm]] = Field( - default=None, - alias="requiredDuringSchedulingIgnoredDuringExecution", - description=( - "If the anti-affinity requirements specified by this field are not met at" - " scheduling time, the pod will not be scheduled onto the node. If the" - " anti-affinity requirements specified by this field cease to be met at" - " some point during pod execution (e.g. due to a pod label update), the" - " system may or may not try to eventually evict the pod from its node. When" - " there are multiple elements, the lists of nodes corresponding to each" - " podAffinityTerm are intersected, i.e. all terms must be satisfied." - ), - ) + preferred_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[WeightedPodAffinityTerm]], + Field( + alias="preferredDuringSchedulingIgnoredDuringExecution", + description=( + "The scheduler will prefer to schedule pods to nodes that satisfy the" + " anti-affinity expressions specified by this field, but it may choose" + " a node that violates one or more of the expressions. The node that is" + " most preferred is the one with the greatest sum of weights, i.e. for" + " each node that meets all of the scheduling requirements (resource" + " request, requiredDuringScheduling anti-affinity expressions, etc.)," + " compute a sum by iterating through the elements of this field and" + ' adding "weight" to the sum if the node has pods which matches the' + " corresponding podAffinityTerm; the node(s) with the highest sum are" + " the most preferred." + ), + ), + ] = None + required_during_scheduling_ignored_during_execution: Annotated[ + Optional[List[PodAffinityTerm]], + Field( + alias="requiredDuringSchedulingIgnoredDuringExecution", + description=( + "If the anti-affinity requirements specified by this field are not met" + " at scheduling time, the pod will not be scheduled onto the node. If" + " the anti-affinity requirements specified by this field cease to be" + " met at some point during pod execution (e.g. due to a pod label" + " update), the system may or may not try to eventually evict the pod" + " from its node. When there are multiple elements, the lists of nodes" + " corresponding to each podAffinityTerm are intersected, i.e. all terms" + " must be satisfied." + ), + ), + ] = None -class VolumeProjection(BaseModel): - config_map: Optional[ConfigMapProjection] = Field( - default=None, - alias="configMap", - description="information about the configMap data to project", - ) - downward_api: Optional[DownwardAPIProjection] = Field( - default=None, - alias="downwardAPI", - description="information about the downwardAPI data to project", - ) - secret: Optional[SecretProjection] = Field( - default=None, description="information about the secret data to project" - ) - service_account_token: Optional[ServiceAccountTokenProjection] = Field( - default=None, - alias="serviceAccountToken", - description="information about the serviceAccountToken data to project", - ) +class ProjectedVolumeSource(BaseModel): + default_mode: Annotated[ + Optional[int], + Field( + alias="defaultMode", + description=( + "Mode bits used to set permissions on created files by default. Must be" + " an octal value between 0000 and 0777 or a decimal value between 0 and" + " 511. YAML accepts both octal and decimal values, JSON requires" + " decimal values for mode bits. Directories within the path are not" + " affected by this setting. This might be in conflict with other" + " options that affect the file mode, like fsGroup, and the result can" + " be other mode bits set." + ), + ), + ] = None + sources: Annotated[ + Optional[List[VolumeProjection]], + Field(description="list of volume projections"), + ] = None class Affinity(BaseModel): - node_affinity: Optional[NodeAffinity] = Field( - default=None, - alias="nodeAffinity", - description="Describes node affinity scheduling rules for the pod.", - ) - pod_affinity: Optional[PodAffinity] = Field( - default=None, - alias="podAffinity", - description=( - "Describes pod affinity scheduling rules (e.g. co-locate this pod in the" - " same node, zone, etc. as some other pod(s))." - ), - ) - pod_anti_affinity: Optional[PodAntiAffinity] = Field( - default=None, - alias="podAntiAffinity", - description=( - "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod" - " in the same node, zone, etc. as some other pod(s))." - ), - ) - - -class Container(BaseModel): - args: Optional[List[str]] = Field( - default=None, - description=( - "Arguments to the entrypoint. The docker image's CMD is used if this is" - " not provided. Variable references $(VAR_NAME) are expanded using the" - " container's environment. If a variable cannot be resolved, the reference" - " in the input string will be unchanged. Double $$ are reduced to a single" - ' $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)"' - ' will produce the string literal "$(VAR_NAME)". Escaped references will' - " never be expanded, regardless of whether the variable exists or not." - " Cannot be updated. More info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - command: Optional[List[str]] = Field( - default=None, - description=( - "Entrypoint array. Not executed within a shell. The docker image's" - " ENTRYPOINT is used if this is not provided. Variable references" - " $(VAR_NAME) are expanded using the container's environment. If a" - " variable cannot be resolved, the reference in the input string will be" - " unchanged. Double $$ are reduced to a single $, which allows for escaping" - ' the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string' - ' literal "$(VAR_NAME)". Escaped references will never be expanded,' - " regardless of whether the variable exists or not. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell" - ), - ) - env: Optional[List[EnvVar]] = Field( - default=None, - description=("List of environment variables to set in the container. Cannot be updated."), - ) - env_from: Optional[List[EnvFromSource]] = Field( - default=None, - alias="envFrom", - description=( - "List of sources to populate environment variables in the container. The" - " keys defined within a source must be a C_IDENTIFIER. All invalid keys" - " will be reported as an event when the container is starting. When a key" - " exists in multiple sources, the value associated with the last source" - " will take precedence. Values defined by an Env with a duplicate key will" - " take precedence. Cannot be updated." - ), - ) - image: str = Field( - ..., - description=( - "Docker image name. More info:" - " https://kubernetes.io/docs/concepts/containers/images This field is" - " optional to allow higher level config management to default or override" - " container images in workload controllers like Deployments and" - " StatefulSets." - ), - ) - image_pull_policy: Optional[str] = Field( - default=None, - alias="imagePullPolicy", - description=( - "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always" - " if :latest tag is specified, or IfNotPresent otherwise. Cannot be" - " updated. More info:" - " https://kubernetes.io/docs/concepts/containers/images#updating-images\n\nPossible" - ' enum values:\n - `"Always"` means that kubelet always attempts to pull' - " the latest image. Container will fail If the pull fails.\n -" - ' `"IfNotPresent"` means that kubelet pulls if the image isn\'t present on' - " disk. Container will fail if the image isn't present and the pull" - ' fails.\n - `"Never"` means that kubelet never pulls an image, but only' - " uses a local image. Container will fail if the image isn't present" - ), - ) - lifecycle: Optional[Lifecycle] = Field( - default=None, - description=( - "Actions that the management system should take in response to container" - " lifecycle events. Cannot be updated." - ), - ) - liveness_probe: Optional[Probe] = Field( - default=None, - alias="livenessProbe", - description=( - "Periodic probe of container liveness. Container will be restarted if the" - " probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name of the container specified as a DNS_LABEL. Each container in a pod" - " must have a unique name (DNS_LABEL). Cannot be updated." - ), - ) - ports: Optional[List[ContainerPort]] = Field( - default=None, - description=( - "List of ports to expose from the container. Exposing a port here gives the" - " system additional information about the network connections a container" - " uses, but is primarily informational. Not specifying a port here DOES NOT" - " prevent that port from being exposed. Any port which is listening on the" - ' default "0.0.0.0" address inside a container will be accessible from the' - " network. Cannot be updated." - ), - ) - readiness_probe: Optional[Probe] = Field( - default=None, - alias="readinessProbe", - description=( - "Periodic probe of container service readiness. Container will be removed" - " from service endpoints if the probe fails. Cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - resources: Optional[ResourceRequirements] = Field( - default=None, - description=( - "Compute Resources required by this container. Cannot be updated. More" - " info:" - " https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/" - ), - ) - security_context: Optional[SecurityContext] = Field( - default=None, - alias="securityContext", - description=( - "SecurityContext defines the security options the container should be run" - " with. If set, the fields of SecurityContext override the equivalent" - " fields of PodSecurityContext. More info:" - " https://kubernetes.io/docs/tasks/configure-pod-container/security-context/" - ), - ) - startup_probe: Optional[Probe] = Field( - default=None, - alias="startupProbe", - description=( - "StartupProbe indicates that the Pod has successfully initialized. If" - " specified, no other probes are executed until this completes" - " successfully. If this probe fails, the Pod will be restarted, just as if" - " the livenessProbe failed. This can be used to provide different probe" - " parameters at the beginning of a Pod's lifecycle, when it might take a" - " long time to load data or warm a cache, than during steady-state" - " operation. This cannot be updated. More info:" - " https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes" - ), - ) - stdin: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a buffer for stdin in the container" - " runtime. If this is not set, reads from stdin in the container will" - " always result in EOF. Default is false." - ), - ) - stdin_once: Optional[bool] = Field( - default=None, - alias="stdinOnce", - description=( - "Whether the container runtime should close the stdin channel after it has" - " been opened by a single attach. When stdin is true the stdin stream will" - " remain open across multiple attach sessions. If stdinOnce is set to true," - " stdin is opened on container start, is empty until the first client" - " attaches to stdin, and then remains open and accepts data until the" - " client disconnects, at which time stdin is closed and remains closed" - " until the container is restarted. If this flag is false, a container" - " processes that reads from stdin will never receive an EOF. Default is" - " false" - ), - ) - termination_message_path: Optional[str] = Field( - default=None, - alias="terminationMessagePath", - description=( - "Optional: Path at which the file to which the container's termination" - " message will be written is mounted into the container's filesystem." - " Message written is intended to be brief final status, such as an" - " assertion failure message. Will be truncated by the node if greater than" - " 4096 bytes. The total message length across all containers will be" - " limited to 12kb. Defaults to /dev/termination-log. Cannot be updated." - ), - ) - termination_message_policy: Optional[TerminationMessagePolicy] = Field( - default=None, - alias="terminationMessagePolicy", - description=( - "Indicate how the termination message should be populated. File will use" - " the contents of terminationMessagePath to populate the container status" - " message on both success and failure. FallbackToLogsOnError will use the" - " last chunk of container log output if the termination message file is" - " empty and the container exited with an error. The log output is limited" - " to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot" - ' be updated.\n\nPossible enum values:\n - `"FallbackToLogsOnError"` will' - " read the most recent contents of the container logs for the container" - " status message when the container exits with an error and the" - ' terminationMessagePath has no contents.\n - `"File"` is the default' - " behavior and will set the container status message to the contents of the" - " container's terminationMessagePath when the container exits." - ), - ) - tty: Optional[bool] = Field( - default=None, - description=( - "Whether this container should allocate a TTY for itself, also requires" - " 'stdin' to be true. Default is false." - ), - ) - volume_devices: Optional[List[VolumeDevice]] = Field( - default=None, - alias="volumeDevices", - description=("volumeDevices is the list of block devices to be used by the container."), - ) - volume_mounts: Optional[List[VolumeMount]] = Field( - default=None, - alias="volumeMounts", - description=("Pod volumes to mount into the container's filesystem. Cannot be updated."), - ) - working_dir: Optional[str] = Field( - default=None, - alias="workingDir", - description=( - "Container's working directory. If not specified, the container runtime's" - " default will be used, which might be configured in the container image." - " Cannot be updated." - ), - ) - - -class ProjectedVolumeSource(BaseModel): - default_mode: Optional[int] = Field( - default=None, - alias="defaultMode", - description=( - "Mode bits used to set permissions on created files by default. Must be an" - " octal value between 0000 and 0777 or a decimal value between 0 and 511." - " YAML accepts both octal and decimal values, JSON requires decimal values" - " for mode bits. Directories within the path are not affected by this" - " setting. This might be in conflict with other options that affect the" - " file mode, like fsGroup, and the result can be other mode bits set." - ), - ) - sources: Optional[List[VolumeProjection]] = Field(default=None, description="list of volume projections") + node_affinity: Annotated[ + Optional[NodeAffinity], + Field( + alias="nodeAffinity", + description="Describes node affinity scheduling rules for the pod.", + ), + ] = None + pod_affinity: Annotated[ + Optional[PodAffinity], + Field( + alias="podAffinity", + description=( + "Describes pod affinity scheduling rules (e.g. co-locate this pod in" + " the same node, zone, etc. as some other pod(s))." + ), + ), + ] = None + pod_anti_affinity: Annotated[ + Optional[PodAntiAffinity], + Field( + alias="podAntiAffinity", + description=( + "Describes pod anti-affinity scheduling rules (e.g. avoid putting this" + " pod in the same node, zone, etc. as some other pod(s))." + ), + ), + ] = None class Volume(BaseModel): - aws_elastic_block_store: Optional[AWSElasticBlockStoreVolumeSource] = Field( - default=None, - alias="awsElasticBlockStore", - description=( - "AWSElasticBlockStore represents an AWS Disk resource that is attached to a" - " kubelet's host machine and then exposed to the pod. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" - ), - ) - azure_disk: Optional[AzureDiskVolumeSource] = Field( - default=None, - alias="azureDisk", - description=("AzureDisk represents an Azure Data Disk mount on the host and bind mount" " to the pod."), - ) - azure_file: Optional[AzureFileVolumeSource] = Field( - default=None, - alias="azureFile", - description=("AzureFile represents an Azure File Service mount on the host and bind" " mount to the pod."), - ) - cephfs: Optional[CephFSVolumeSource] = Field( - default=None, - description=("CephFS represents a Ceph FS mount on the host that shares a pod's lifetime"), - ) - cinder: Optional[CinderVolumeSource] = Field( - default=None, - description=( - "Cinder represents a cinder volume attached and mounted on kubelets host" - " machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md" - ), - ) - config_map: Optional[ConfigMapVolumeSource] = Field( - default=None, - alias="configMap", - description="ConfigMap represents a configMap that should populate this volume", - ) - csi: Optional[CSIVolumeSource] = Field( - default=None, - description=( - "CSI (Container Storage Interface) represents ephemeral storage that is" - " handled by certain external CSI drivers (Beta feature)." - ), - ) - downward_api: Optional[DownwardAPIVolumeSource] = Field( - default=None, - alias="downwardAPI", - description=("DownwardAPI represents downward API about the pod that should populate" " this volume"), - ) - empty_dir: Optional[EmptyDirVolumeSource] = Field( - default=None, - alias="emptyDir", - description=( - "EmptyDir represents a temporary directory that shares a pod's lifetime." - " More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir" - ), - ) - ephemeral: Optional[EphemeralVolumeSource] = Field( - default=None, - description=( - "Ephemeral represents a volume that is handled by a cluster storage driver." - " The volume's lifecycle is tied to the pod that defines it - it will be" - " created before the pod starts, and deleted when the pod is" - " removed.\n\nUse this if: a) the volume is only needed while the pod runs," - " b) features of normal volumes like restoring from snapshot or capacity\n " - " tracking are needed,\nc) the storage driver is specified through a" - " storage class, and d) the storage driver supports dynamic volume" - " provisioning through\n a PersistentVolumeClaim (see" - " EphemeralVolumeSource for more\n information on the connection between" - " this volume type\n and PersistentVolumeClaim).\n\nUse" - " PersistentVolumeClaim or one of the vendor-specific APIs for volumes that" - " persist for longer than the lifecycle of an individual pod.\n\nUse CSI" - " for light-weight local ephemeral volumes if the CSI driver is meant to be" - " used that way - see the documentation of the driver for more" - " information.\n\nA pod can use both types of ephemeral volumes and" - " persistent volumes at the same time." - ), - ) - fc: Optional[FCVolumeSource] = Field( - default=None, - description=( - "FC represents a Fibre Channel resource that is attached to a kubelet's" - " host machine and then exposed to the pod." - ), - ) - flex_volume: Optional[FlexVolumeSource] = Field( - default=None, - alias="flexVolume", - description=( - "FlexVolume represents a generic volume resource that is" - " provisioned/attached using an exec based plugin." - ), - ) - flocker: Optional[FlockerVolumeSource] = Field( - default=None, - description=( - "Flocker represents a Flocker volume attached to a kubelet's host machine." - " This depends on the Flocker control service being running" - ), - ) - gce_persistent_disk: Optional[GCEPersistentDiskVolumeSource] = Field( - default=None, - alias="gcePersistentDisk", - description=( - "GCEPersistentDisk represents a GCE Disk resource that is attached to a" - " kubelet's host machine and then exposed to the pod. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" - ), - ) - git_repo: Optional[GitRepoVolumeSource] = Field( - default=None, - alias="gitRepo", - description=( - "GitRepo represents a git repository at a particular revision. DEPRECATED:" - " GitRepo is deprecated. To provision a container with a git repo, mount an" - " EmptyDir into an InitContainer that clones the repo using git, then mount" - " the EmptyDir into the Pod's container." - ), - ) - glusterfs: Optional[GlusterfsVolumeSource] = Field( - default=None, - description=( - "Glusterfs represents a Glusterfs mount on the host that shares a pod's" - " lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md" - ), - ) - host_path: Optional[HostPathVolumeSource] = Field( - default=None, - alias="hostPath", - description=( - "HostPath represents a pre-existing file or directory on the host machine" - " that is directly exposed to the container. This is generally used for" - " system agents or other privileged things that are allowed to see the host" - " machine. Most containers will NOT need this. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" - ), - ) - iscsi: Optional[ISCSIVolumeSource] = Field( - default=None, - description=( - "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's" - " host machine and then exposed to the pod. More info:" - " https://examples.k8s.io/volumes/iscsi/README.md" - ), - ) - name: str = Field( - ..., - description=( - "Volume's name. Must be a DNS_LABEL and unique within the pod. More info:" - " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" - ), - ) - nfs: Optional[NFSVolumeSource] = Field( - default=None, - description=( - "NFS represents an NFS mount on the host that shares a pod's lifetime More" - " info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" - ), - ) - persistent_volume_claim: Optional[PersistentVolumeClaimVolumeSource] = Field( - default=None, - alias="persistentVolumeClaim", - description=( - "PersistentVolumeClaimVolumeSource represents a reference to a" - " PersistentVolumeClaim in the same namespace. More info:" - " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" - ), - ) - photon_persistent_disk: Optional[PhotonPersistentDiskVolumeSource] = Field( - default=None, - alias="photonPersistentDisk", - description=( - "PhotonPersistentDisk represents a PhotonController persistent disk" - " attached and mounted on kubelets host machine" - ), - ) - portworx_volume: Optional[PortworxVolumeSource] = Field( - default=None, - alias="portworxVolume", - description=("PortworxVolume represents a portworx volume attached and mounted on" " kubelets host machine"), - ) - projected: Optional[ProjectedVolumeSource] = Field( - default=None, - description=("Items for all in one resources secrets, configmaps, and downward API"), - ) - quobyte: Optional[QuobyteVolumeSource] = Field( - default=None, - description=("Quobyte represents a Quobyte mount on the host that shares a pod's" " lifetime"), - ) - rbd: Optional[RBDVolumeSource] = Field( - default=None, - description=( - "RBD represents a Rados Block Device mount on the host that shares a pod's" - " lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md" - ), - ) - scale_io: Optional[ScaleIOVolumeSource] = Field( - default=None, - alias="scaleIO", - description=("ScaleIO represents a ScaleIO persistent volume attached and mounted on" " Kubernetes nodes."), - ) - secret: Optional[SecretVolumeSource] = Field( - default=None, - description=( - "Secret represents a secret that should populate this volume. More info:" - " https://kubernetes.io/docs/concepts/storage/volumes#secret" - ), - ) - storageos: Optional[StorageOSVolumeSource] = Field( - default=None, - description=("StorageOS represents a StorageOS volume attached and mounted on Kubernetes" " nodes."), - ) - vsphere_volume: Optional[VsphereVirtualDiskVolumeSource] = Field( - default=None, - alias="vsphereVolume", - description=("VsphereVolume represents a vSphere volume attached and mounted on kubelets" " host machine"), - ) + aws_elastic_block_store: Annotated[ + Optional[AWSElasticBlockStoreVolumeSource], + Field( + alias="awsElasticBlockStore", + description=( + "AWSElasticBlockStore represents an AWS Disk resource that is attached" + " to a kubelet's host machine and then exposed to the pod. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore" + ), + ), + ] = None + azure_disk: Annotated[ + Optional[AzureDiskVolumeSource], + Field( + alias="azureDisk", + description=("AzureDisk represents an Azure Data Disk mount on the host and bind" " mount to the pod."), + ), + ] = None + azure_file: Annotated[ + Optional[AzureFileVolumeSource], + Field( + alias="azureFile", + description=("AzureFile represents an Azure File Service mount on the host and bind" " mount to the pod."), + ), + ] = None + cephfs: Annotated[ + Optional[CephFSVolumeSource], + Field(description=("CephFS represents a Ceph FS mount on the host that shares a pod's" " lifetime")), + ] = None + cinder: Annotated[ + Optional[CinderVolumeSource], + Field( + description=( + "Cinder represents a cinder volume attached and mounted on kubelets" + " host machine. More info:" + " https://examples.k8s.io/mysql-cinder-pd/README.md" + ) + ), + ] = None + config_map: Annotated[ + Optional[ConfigMapVolumeSource], + Field( + alias="configMap", + description=("ConfigMap represents a configMap that should populate this volume"), + ), + ] = None + csi: Annotated[ + Optional[CSIVolumeSource], + Field( + description=( + "CSI (Container Storage Interface) represents ephemeral storage that is" + " handled by certain external CSI drivers (Beta feature)." + ) + ), + ] = None + downward_api: Annotated[ + Optional[DownwardAPIVolumeSource], + Field( + alias="downwardAPI", + description=("DownwardAPI represents downward API about the pod that should populate" " this volume"), + ), + ] = None + empty_dir: Annotated[ + Optional[EmptyDirVolumeSource], + Field( + alias="emptyDir", + description=( + "EmptyDir represents a temporary directory that shares a pod's" + " lifetime. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#emptydir" + ), + ), + ] = None + ephemeral: Annotated[ + Optional[EphemeralVolumeSource], + Field( + description=( + "Ephemeral represents a volume that is handled by a cluster storage" + " driver. The volume's lifecycle is tied to the pod that defines it -" + " it will be created before the pod starts, and deleted when the pod is" + " removed.\n\nUse this if: a) the volume is only needed while the pod" + " runs, b) features of normal volumes like restoring from snapshot or" + " capacity\n tracking are needed,\nc) the storage driver is specified" + " through a storage class, and d) the storage driver supports dynamic" + " volume provisioning through\n a PersistentVolumeClaim (see" + " EphemeralVolumeSource for more\n information on the connection" + " between this volume type\n and PersistentVolumeClaim).\n\nUse" + " PersistentVolumeClaim or one of the vendor-specific APIs for volumes" + " that persist for longer than the lifecycle of an individual" + " pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI" + " driver is meant to be used that way - see the documentation of the" + " driver for more information.\n\nA pod can use both types of ephemeral" + " volumes and persistent volumes at the same time." + ) + ), + ] = None + fc: Annotated[ + Optional[FCVolumeSource], + Field( + description=( + "FC represents a Fibre Channel resource that is attached to a kubelet's" + " host machine and then exposed to the pod." + ) + ), + ] = None + flex_volume: Annotated[ + Optional[FlexVolumeSource], + Field( + alias="flexVolume", + description=( + "FlexVolume represents a generic volume resource that is" + " provisioned/attached using an exec based plugin." + ), + ), + ] = None + flocker: Annotated[ + Optional[FlockerVolumeSource], + Field( + description=( + "Flocker represents a Flocker volume attached to a kubelet's host" + " machine. This depends on the Flocker control service being running" + ) + ), + ] = None + gce_persistent_disk: Annotated[ + Optional[GCEPersistentDiskVolumeSource], + Field( + alias="gcePersistentDisk", + description=( + "GCEPersistentDisk represents a GCE Disk resource that is attached to a" + " kubelet's host machine and then exposed to the pod. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk" + ), + ), + ] = None + git_repo: Annotated[ + Optional[GitRepoVolumeSource], + Field( + alias="gitRepo", + description=( + "GitRepo represents a git repository at a particular revision." + " DEPRECATED: GitRepo is deprecated. To provision a container with a" + " git repo, mount an EmptyDir into an InitContainer that clones the" + " repo using git, then mount the EmptyDir into the Pod's container." + ), + ), + ] = None + glusterfs: Annotated[ + Optional[GlusterfsVolumeSource], + Field( + description=( + "Glusterfs represents a Glusterfs mount on the host that shares a pod's" + " lifetime. More info:" + " https://examples.k8s.io/volumes/glusterfs/README.md" + ) + ), + ] = None + host_path: Annotated[ + Optional[HostPathVolumeSource], + Field( + alias="hostPath", + description=( + "HostPath represents a pre-existing file or directory on the host" + " machine that is directly exposed to the container. This is generally" + " used for system agents or other privileged things that are allowed to" + " see the host machine. Most containers will NOT need this. More info:" + " https://kubernetes.io/docs/concepts/storage/volumes#hostpath" + ), + ), + ] = None + iscsi: Annotated[ + Optional[ISCSIVolumeSource], + Field( + description=( + "ISCSI represents an ISCSI Disk resource that is attached to a" + " kubelet's host machine and then exposed to the pod. More info:" + " https://examples.k8s.io/volumes/iscsi/README.md" + ) + ), + ] = None + name: Annotated[ + str, + Field( + description=( + "Volume's name. Must be a DNS_LABEL and unique within the pod. More" + " info:" + " https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names" + ) + ), + ] + nfs: Annotated[ + Optional[NFSVolumeSource], + Field( + description=( + "NFS represents an NFS mount on the host that shares a pod's lifetime" + " More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs" + ) + ), + ] = None + persistent_volume_claim: Annotated[ + Optional[PersistentVolumeClaimVolumeSource], + Field( + alias="persistentVolumeClaim", + description=( + "PersistentVolumeClaimVolumeSource represents a reference to a" + " PersistentVolumeClaim in the same namespace. More info:" + " https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims" + ), + ), + ] = None + photon_persistent_disk: Annotated[ + Optional[PhotonPersistentDiskVolumeSource], + Field( + alias="photonPersistentDisk", + description=( + "PhotonPersistentDisk represents a PhotonController persistent disk" + " attached and mounted on kubelets host machine" + ), + ), + ] = None + portworx_volume: Annotated[ + Optional[PortworxVolumeSource], + Field( + alias="portworxVolume", + description=( + "PortworxVolume represents a portworx volume attached and mounted on" " kubelets host machine" + ), + ), + ] = None + projected: Annotated[ + Optional[ProjectedVolumeSource], + Field(description=("Items for all in one resources secrets, configmaps, and downward API")), + ] = None + quobyte: Annotated[ + Optional[QuobyteVolumeSource], + Field(description=("Quobyte represents a Quobyte mount on the host that shares a pod's" " lifetime")), + ] = None + rbd: Annotated[ + Optional[RBDVolumeSource], + Field( + description=( + "RBD represents a Rados Block Device mount on the host that shares a" + " pod's lifetime. More info:" + " https://examples.k8s.io/volumes/rbd/README.md" + ) + ), + ] = None + scale_io: Annotated[ + Optional[ScaleIOVolumeSource], + Field( + alias="scaleIO", + description=( + "ScaleIO represents a ScaleIO persistent volume attached and mounted on" " Kubernetes nodes." + ), + ), + ] = None + secret: Annotated[ + Optional[SecretVolumeSource], + Field( + description=( + "Secret represents a secret that should populate this volume. More" + " info: https://kubernetes.io/docs/concepts/storage/volumes#secret" + ) + ), + ] = None + storageos: Annotated[ + Optional[StorageOSVolumeSource], + Field(description=("StorageOS represents a StorageOS volume attached and mounted on" " Kubernetes nodes.")), + ] = None + vsphere_volume: Annotated[ + Optional[VsphereVirtualDiskVolumeSource], + Field( + alias="vsphereVolume", + description=("VsphereVolume represents a vSphere volume attached and mounted on" " kubelets host machine"), + ), + ] = None diff --git a/src/hera/workflows/models/io/k8s/api/core/v1.pyi b/src/hera/workflows/models/io/k8s/api/core/v1.pyi deleted file mode 100644 index bb112abd7..000000000 --- a/src/hera/workflows/models/io/k8s/api/core/v1.pyi +++ /dev/null @@ -1,640 +0,0 @@ -from enum import Enum -from typing import Dict, List, Optional - -from hera.shared._pydantic import ( - BaseModel as BaseModel, - Field as Field, -) - -from ...apimachinery.pkg.api import resource as resource -from ...apimachinery.pkg.apis.meta import v1 as v1 -from ...apimachinery.pkg.util import intstr as intstr - -class AWSElasticBlockStoreVolumeSource(BaseModel): - fs_type: Optional[str] - partition: Optional[int] - read_only: Optional[bool] - volume_id: str - -class AzureDiskVolumeSource(BaseModel): - caching_mode: Optional[str] - disk_name: str - disk_uri: str - fs_type: Optional[str] - kind: Optional[str] - read_only: Optional[bool] - -class AzureFileVolumeSource(BaseModel): - read_only: Optional[bool] - secret_name: str - share_name: str - -class Capabilities(BaseModel): - add: Optional[List[str]] - drop: Optional[List[str]] - -class ConfigMapEnvSource(BaseModel): - name: Optional[str] - optional: Optional[bool] - -class ConfigMapKeySelector(BaseModel): - key: str - name: Optional[str] - optional: Optional[bool] - -class TerminationMessagePolicy(Enum): - fallback_to_logs_on_error: str - file: str - -class Protocol(Enum): - sctp: str - tcp: str - udp: str - -class ContainerPort(BaseModel): - container_port: int - host_ip: Optional[str] - host_port: Optional[int] - name: Optional[str] - protocol: Optional[Protocol] - -class EventSource(BaseModel): - component: Optional[str] - host: Optional[str] - -class ExecAction(BaseModel): - command: Optional[List[str]] - -class FCVolumeSource(BaseModel): - fs_type: Optional[str] - lun: Optional[int] - read_only: Optional[bool] - target_ww_ns: Optional[List[str]] - wwids: Optional[List[str]] - -class FlockerVolumeSource(BaseModel): - dataset_name: Optional[str] - dataset_uuid: Optional[str] - -class GCEPersistentDiskVolumeSource(BaseModel): - fs_type: Optional[str] - partition: Optional[int] - pd_name: str - read_only: Optional[bool] - -class GRPCAction(BaseModel): - port: int - service: Optional[str] - -class GitRepoVolumeSource(BaseModel): - directory: Optional[str] - repository: str - revision: Optional[str] - -class GlusterfsVolumeSource(BaseModel): - endpoints: str - path: str - read_only: Optional[bool] - -class Scheme(Enum): - http: str - https: str - -class HTTPHeader(BaseModel): - name: str - value: str - -class HostAlias(BaseModel): - hostnames: Optional[List[str]] - ip: Optional[str] - -class HostPathVolumeSource(BaseModel): - path: str - type: Optional[str] - -class KeyToPath(BaseModel): - key: str - mode: Optional[int] - path: str - -class LocalObjectReference(BaseModel): - name: Optional[str] - -class NFSVolumeSource(BaseModel): - path: str - read_only: Optional[bool] - server: str - -class Operator(Enum): - does_not_exist: str - exists: str - gt: str - in_: str - lt: str - not_in: str - -class NodeSelectorRequirement(BaseModel): - key: str - operator: Operator - values: Optional[List[str]] - -class NodeSelectorTerm(BaseModel): - match_expressions: Optional[List[NodeSelectorRequirement]] - match_fields: Optional[List[NodeSelectorRequirement]] - -class ObjectFieldSelector(BaseModel): - api_version: Optional[str] - field_path: str - -class ObjectReference(BaseModel): - api_version: Optional[str] - field_path: Optional[str] - kind: Optional[str] - name: Optional[str] - namespace: Optional[str] - resource_version: Optional[str] - uid: Optional[str] - -class Type(Enum): - file_system_resize_pending: str - resizing: str - -class Phase(Enum): - bound: str - lost: str - pending: str - -class PersistentVolumeClaimVolumeSource(BaseModel): - claim_name: str - read_only: Optional[bool] - -class PhotonPersistentDiskVolumeSource(BaseModel): - fs_type: Optional[str] - pd_id: str - -class PodDNSConfigOption(BaseModel): - name: Optional[str] - value: Optional[str] - -class PortworxVolumeSource(BaseModel): - fs_type: Optional[str] - read_only: Optional[bool] - volume_id: str - -class PreferredSchedulingTerm(BaseModel): - preference: NodeSelectorTerm - weight: int - -class QuobyteVolumeSource(BaseModel): - group: Optional[str] - read_only: Optional[bool] - registry: str - tenant: Optional[str] - user: Optional[str] - volume: str - -class RBDVolumeSource(BaseModel): - fs_type: Optional[str] - image: str - keyring: Optional[str] - monitors: List[str] - pool: Optional[str] - read_only: Optional[bool] - secret_ref: Optional[LocalObjectReference] - user: Optional[str] - -class SELinuxOptions(BaseModel): - level: Optional[str] - role: Optional[str] - type: Optional[str] - user: Optional[str] - -class ScaleIOVolumeSource(BaseModel): - fs_type: Optional[str] - gateway: str - protection_domain: Optional[str] - read_only: Optional[bool] - secret_ref: LocalObjectReference - ssl_enabled: Optional[bool] - storage_mode: Optional[str] - storage_pool: Optional[str] - system: str - volume_name: Optional[str] - -class TypeModel(Enum): - localhost: str - runtime_default: str - unconfined: str - -class SeccompProfile(BaseModel): - localhost_profile: Optional[str] - type: TypeModel - -class SecretEnvSource(BaseModel): - name: Optional[str] - optional: Optional[bool] - -class SecretKeySelector(BaseModel): - key: str - name: Optional[str] - optional: Optional[bool] - -class SecretProjection(BaseModel): - items: Optional[List[KeyToPath]] - name: Optional[str] - optional: Optional[bool] - -class SecretVolumeSource(BaseModel): - default_mode: Optional[int] - items: Optional[List[KeyToPath]] - optional: Optional[bool] - secret_name: Optional[str] - -class ServiceAccountTokenProjection(BaseModel): - audience: Optional[str] - expiration_seconds: Optional[int] - path: str - -class StorageOSVolumeSource(BaseModel): - fs_type: Optional[str] - read_only: Optional[bool] - secret_ref: Optional[LocalObjectReference] - volume_name: Optional[str] - volume_namespace: Optional[str] - -class Sysctl(BaseModel): - name: str - value: str - -class Effect(Enum): - no_execute: str - no_schedule: str - prefer_no_schedule: str - -class OperatorModel(Enum): - equal: str - exists: str - -class Toleration(BaseModel): - effect: Optional[Effect] - key: Optional[str] - operator: Optional[OperatorModel] - toleration_seconds: Optional[int] - value: Optional[str] - -class TypedLocalObjectReference(BaseModel): - api_group: Optional[str] - kind: str - name: str - -class VolumeDevice(BaseModel): - device_path: str - name: str - -class VolumeMount(BaseModel): - mount_path: str - mount_propagation: Optional[str] - name: str - read_only: Optional[bool] - sub_path: Optional[str] - sub_path_expr: Optional[str] - -class VsphereVirtualDiskVolumeSource(BaseModel): - fs_type: Optional[str] - storage_policy_id: Optional[str] - storage_policy_name: Optional[str] - volume_path: str - -class WindowsSecurityContextOptions(BaseModel): - gmsa_credential_spec: Optional[str] - gmsa_credential_spec_name: Optional[str] - host_process: Optional[bool] - run_as_user_name: Optional[str] - -class ImagePullPolicy(Enum): - always: str - never: str - if_not_present: str - -class CSIVolumeSource(BaseModel): - driver: str - fs_type: Optional[str] - node_publish_secret_ref: Optional[LocalObjectReference] - read_only: Optional[bool] - volume_attributes: Optional[Dict[str, str]] - -class CephFSVolumeSource(BaseModel): - monitors: List[str] - path: Optional[str] - read_only: Optional[bool] - secret_file: Optional[str] - secret_ref: Optional[LocalObjectReference] - user: Optional[str] - -class CinderVolumeSource(BaseModel): - fs_type: Optional[str] - read_only: Optional[bool] - secret_ref: Optional[LocalObjectReference] - volume_id: str - -class ConfigMapProjection(BaseModel): - items: Optional[List[KeyToPath]] - name: Optional[str] - optional: Optional[bool] - -class ConfigMapVolumeSource(BaseModel): - default_mode: Optional[int] - items: Optional[List[KeyToPath]] - name: Optional[str] - optional: Optional[bool] - -class EmptyDirVolumeSource(BaseModel): - medium: Optional[str] - size_limit: Optional[resource.Quantity] - -class EnvFromSource(BaseModel): - config_map_ref: Optional[ConfigMapEnvSource] - prefix: Optional[str] - secret_ref: Optional[SecretEnvSource] - -class EventSeries(BaseModel): - count: Optional[int] - last_observed_time: Optional[v1.MicroTime] - -class FlexVolumeSource(BaseModel): - driver: str - fs_type: Optional[str] - options: Optional[Dict[str, str]] - read_only: Optional[bool] - secret_ref: Optional[LocalObjectReference] - -class HTTPGetAction(BaseModel): - host: Optional[str] - http_headers: Optional[List[HTTPHeader]] - path: Optional[str] - port: int - scheme: Optional[Scheme] - -class ISCSIVolumeSource(BaseModel): - chap_auth_discovery: Optional[bool] - chap_auth_session: Optional[bool] - fs_type: Optional[str] - initiator_name: Optional[str] - iqn: str - iscsi_interface: Optional[str] - lun: int - portals: Optional[List[str]] - read_only: Optional[bool] - secret_ref: Optional[LocalObjectReference] - target_portal: str - -class NodeSelector(BaseModel): - node_selector_terms: List[NodeSelectorTerm] - -class PersistentVolumeClaimCondition(BaseModel): - last_probe_time: Optional[v1.Time] - last_transition_time: Optional[v1.Time] - message: Optional[str] - reason: Optional[str] - status: str - type: Type - -class PersistentVolumeClaimStatus(BaseModel): - access_modes: Optional[List[str]] - allocated_resources: Optional[Dict[str, resource.Quantity]] - capacity: Optional[Dict[str, resource.Quantity]] - conditions: Optional[List[PersistentVolumeClaimCondition]] - phase: Optional[Phase] - resize_status: Optional[str] - -class PodDNSConfig(BaseModel): - nameservers: Optional[List[str]] - options: Optional[List[PodDNSConfigOption]] - searches: Optional[List[str]] - -class PodSecurityContext(BaseModel): - fs_group: Optional[int] - fs_group_change_policy: Optional[str] - run_as_group: Optional[int] - run_as_non_root: Optional[bool] - run_as_user: Optional[int] - se_linux_options: Optional[SELinuxOptions] - seccomp_profile: Optional[SeccompProfile] - supplemental_groups: Optional[List[int]] - sysctls: Optional[List[Sysctl]] - windows_options: Optional[WindowsSecurityContextOptions] - -class ResourceFieldSelector(BaseModel): - container_name: Optional[str] - divisor: Optional[resource.Quantity] - resource: str - -class ResourceRequirements(BaseModel): - limits: Optional[Dict[str, resource.Quantity]] - requests: Optional[Dict[str, resource.Quantity]] - -class SecurityContext(BaseModel): - allow_privilege_escalation: Optional[bool] - capabilities: Optional[Capabilities] - privileged: Optional[bool] - proc_mount: Optional[str] - read_only_root_filesystem: Optional[bool] - run_as_group: Optional[int] - run_as_non_root: Optional[bool] - run_as_user: Optional[int] - se_linux_options: Optional[SELinuxOptions] - seccomp_profile: Optional[SeccompProfile] - windows_options: Optional[WindowsSecurityContextOptions] - -class ServicePort(BaseModel): - app_protocol: Optional[str] - name: Optional[str] - node_port: Optional[int] - port: int - protocol: Optional[Protocol] - target_port: Optional[intstr.IntOrString] - -class TCPSocketAction(BaseModel): - host: Optional[str] - port: intstr.IntOrString - -class DownwardAPIVolumeFile(BaseModel): - field_ref: Optional[ObjectFieldSelector] - mode: Optional[int] - path: str - resource_field_ref: Optional[ResourceFieldSelector] - -class DownwardAPIVolumeSource(BaseModel): - default_mode: Optional[int] - items: Optional[List[DownwardAPIVolumeFile]] - -class EnvVarSource(BaseModel): - config_map_key_ref: Optional[ConfigMapKeySelector] - field_ref: Optional[ObjectFieldSelector] - resource_field_ref: Optional[ResourceFieldSelector] - secret_key_ref: Optional[SecretKeySelector] - -class Event(BaseModel): - action: Optional[str] - api_version: Optional[str] - count: Optional[int] - event_time: Optional[v1.MicroTime] - first_timestamp: Optional[v1.Time] - involved_object: ObjectReference - kind: Optional[str] - last_timestamp: Optional[v1.Time] - message: Optional[str] - metadata: v1.ObjectMeta - reason: Optional[str] - related: Optional[ObjectReference] - reporting_component: Optional[str] - reporting_instance: Optional[str] - series: Optional[EventSeries] - source: Optional[EventSource] - type: Optional[str] - -class LifecycleHandler(BaseModel): - exec: Optional[ExecAction] - http_get: Optional[HTTPGetAction] - tcp_socket: Optional[TCPSocketAction] - -class NodeAffinity(BaseModel): - preferred_during_scheduling_ignored_during_execution: Optional[List[PreferredSchedulingTerm]] - required_during_scheduling_ignored_during_execution: Optional[NodeSelector] - -class PersistentVolumeClaimSpec(BaseModel): - access_modes: Optional[List[str]] - data_source: Optional[TypedLocalObjectReference] - data_source_ref: Optional[TypedLocalObjectReference] - resources: Optional[ResourceRequirements] - selector: Optional[v1.LabelSelector] - storage_class_name: Optional[str] - volume_mode: Optional[str] - volume_name: Optional[str] - -class PersistentVolumeClaimTemplate(BaseModel): - metadata: Optional[v1.ObjectMeta] - spec: PersistentVolumeClaimSpec - -class PodAffinityTerm(BaseModel): - label_selector: Optional[v1.LabelSelector] - namespace_selector: Optional[v1.LabelSelector] - namespaces: Optional[List[str]] - topology_key: str - -class Probe(BaseModel): - exec: Optional[ExecAction] - failure_threshold: Optional[int] - grpc: Optional[GRPCAction] - http_get: Optional[HTTPGetAction] - initial_delay_seconds: Optional[int] - period_seconds: Optional[int] - success_threshold: Optional[int] - tcp_socket: Optional[TCPSocketAction] - termination_grace_period_seconds: Optional[int] - timeout_seconds: Optional[int] - -class WeightedPodAffinityTerm(BaseModel): - pod_affinity_term: PodAffinityTerm - weight: int - -class DownwardAPIProjection(BaseModel): - items: Optional[List[DownwardAPIVolumeFile]] - -class EnvVar(BaseModel): - name: str - value: Optional[str] - value_from: Optional[EnvVarSource] - -class EphemeralVolumeSource(BaseModel): - volume_claim_template: Optional[PersistentVolumeClaimTemplate] - -class Lifecycle(BaseModel): - post_start: Optional[LifecycleHandler] - pre_stop: Optional[LifecycleHandler] - -class PersistentVolumeClaim(BaseModel): - api_version: Optional[str] - kind: Optional[str] - metadata: Optional[v1.ObjectMeta] - spec: Optional[PersistentVolumeClaimSpec] - status: Optional[PersistentVolumeClaimStatus] - -class PodAffinity(BaseModel): - preferred_during_scheduling_ignored_during_execution: Optional[List[WeightedPodAffinityTerm]] - required_during_scheduling_ignored_during_execution: Optional[List[PodAffinityTerm]] - -class PodAntiAffinity(BaseModel): - preferred_during_scheduling_ignored_during_execution: Optional[List[WeightedPodAffinityTerm]] - required_during_scheduling_ignored_during_execution: Optional[List[PodAffinityTerm]] - -class VolumeProjection(BaseModel): - config_map: Optional[ConfigMapProjection] - downward_api: Optional[DownwardAPIProjection] - secret: Optional[SecretProjection] - service_account_token: Optional[ServiceAccountTokenProjection] - -class Affinity(BaseModel): - node_affinity: Optional[NodeAffinity] - pod_affinity: Optional[PodAffinity] - pod_anti_affinity: Optional[PodAntiAffinity] - -class Container(BaseModel): - args: Optional[List[str]] - command: Optional[List[str]] - env: Optional[List[EnvVar]] - env_from: Optional[List[EnvFromSource]] - image: str - image_pull_policy: Optional[str] - lifecycle: Optional[Lifecycle] - liveness_probe: Optional[Probe] - name: Optional[str] - ports: Optional[List[ContainerPort]] - readiness_probe: Optional[Probe] - resources: Optional[ResourceRequirements] - security_context: Optional[SecurityContext] - startup_probe: Optional[Probe] - stdin: Optional[bool] - stdin_once: Optional[bool] - termination_message_path: Optional[str] - termination_message_policy: Optional[TerminationMessagePolicy] - tty: Optional[bool] - volume_devices: Optional[List[VolumeDevice]] - volume_mounts: Optional[List[VolumeMount]] - working_dir: Optional[str] - -class ProjectedVolumeSource(BaseModel): - default_mode: Optional[int] - sources: Optional[List[VolumeProjection]] - -class Volume(BaseModel): - aws_elastic_block_store: Optional[AWSElasticBlockStoreVolumeSource] - azure_disk: Optional[AzureDiskVolumeSource] - azure_file: Optional[AzureFileVolumeSource] - cephfs: Optional[CephFSVolumeSource] - cinder: Optional[CinderVolumeSource] - config_map: Optional[ConfigMapVolumeSource] - csi: Optional[CSIVolumeSource] - downward_api: Optional[DownwardAPIVolumeSource] - empty_dir: Optional[EmptyDirVolumeSource] - ephemeral: Optional[EphemeralVolumeSource] - fc: Optional[FCVolumeSource] - flex_volume: Optional[FlexVolumeSource] - flocker: Optional[FlockerVolumeSource] - gce_persistent_disk: Optional[GCEPersistentDiskVolumeSource] - git_repo: Optional[GitRepoVolumeSource] - glusterfs: Optional[GlusterfsVolumeSource] - host_path: Optional[HostPathVolumeSource] - iscsi: Optional[ISCSIVolumeSource] - name: str - nfs: Optional[NFSVolumeSource] - persistent_volume_claim: Optional[PersistentVolumeClaimVolumeSource] - photon_persistent_disk: Optional[PhotonPersistentDiskVolumeSource] - portworx_volume: Optional[PortworxVolumeSource] - projected: Optional[ProjectedVolumeSource] - quobyte: Optional[QuobyteVolumeSource] - rbd: Optional[RBDVolumeSource] - scale_io: Optional[ScaleIOVolumeSource] - secret: Optional[SecretVolumeSource] - storageos: Optional[StorageOSVolumeSource] - vsphere_volume: Optional[VsphereVirtualDiskVolumeSource] diff --git a/src/hera/workflows/models/io/k8s/api/policy/v1beta1.py b/src/hera/workflows/models/io/k8s/api/policy/v1beta1.py index 3df7c5731..5c81ecedd 100644 --- a/src/hera/workflows/models/io/k8s/api/policy/v1beta1.py +++ b/src/hera/workflows/models/io/k8s/api/policy/v1beta1.py @@ -5,6 +5,8 @@ from typing import Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from ...apimachinery.pkg.apis.meta import v1 @@ -12,33 +14,40 @@ class PodDisruptionBudgetSpec(BaseModel): - max_unavailable: Optional[intstr.IntOrString] = Field( - default=None, - alias="maxUnavailable", - description=( - 'An eviction is allowed if at most "maxUnavailable" pods selected by' - ' "selector" are unavailable after the eviction, i.e. even in absence of' - " the evicted pod. For example, one can prevent all voluntary evictions by" - ' specifying 0. This is a mutually exclusive setting with "minAvailable".' + max_unavailable: Annotated[ + Optional[intstr.IntOrString], + Field( + alias="maxUnavailable", + description=( + 'An eviction is allowed if at most "maxUnavailable" pods selected by' + ' "selector" are unavailable after the eviction, i.e. even in absence' + " of the evicted pod. For example, one can prevent all voluntary" + " evictions by specifying 0. This is a mutually exclusive setting with" + ' "minAvailable".' + ), ), - ) - min_available: Optional[intstr.IntOrString] = Field( - default=None, - alias="minAvailable", - description=( - 'An eviction is allowed if at least "minAvailable" pods selected by' - ' "selector" will still be available after the eviction, i.e. even in the' - " absence of the evicted pod. So for example you can prevent all voluntary" - ' evictions by specifying "100%".' + ] = None + min_available: Annotated[ + Optional[intstr.IntOrString], + Field( + alias="minAvailable", + description=( + 'An eviction is allowed if at least "minAvailable" pods selected by' + ' "selector" will still be available after the eviction, i.e. even in' + " the absence of the evicted pod. So for example you can prevent all" + ' voluntary evictions by specifying "100%".' + ), ), - ) - selector: Optional[v1.LabelSelector] = Field( - default=None, - description=( - "Label query over pods whose evictions are managed by the disruption" - " budget. A null selector selects no pods. An empty selector ({}) also" - " selects no pods, which differs from standard behavior of selecting all" - " pods. In policy/v1, an empty selector will select all pods in the" - " namespace." + ] = None + selector: Annotated[ + Optional[v1.LabelSelector], + Field( + description=( + "Label query over pods whose evictions are managed by the disruption" + " budget. A null selector selects no pods. An empty selector ({}) also" + " selects no pods, which differs from standard behavior of selecting" + " all pods. In policy/v1, an empty selector will select all pods in the" + " namespace." + ) ), - ) + ] = None diff --git a/src/hera/workflows/models/io/k8s/api/policy/v1beta1.pyi b/src/hera/workflows/models/io/k8s/api/policy/v1beta1.pyi deleted file mode 100644 index bb510518f..000000000 --- a/src/hera/workflows/models/io/k8s/api/policy/v1beta1.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from typing import Optional - -from hera.shared._pydantic import ( - BaseModel as BaseModel, - Field as Field, -) - -from ...apimachinery.pkg.apis.meta import v1 as v1 -from ...apimachinery.pkg.util import intstr as intstr - -class PodDisruptionBudgetSpec(BaseModel): - max_unavailable: Optional[intstr.IntOrString] - min_available: Optional[intstr.IntOrString] - selector: Optional[v1.LabelSelector] diff --git a/src/hera/workflows/models/io/k8s/apimachinery/pkg/api/resource.py b/src/hera/workflows/models/io/k8s/apimachinery/pkg/api/resource.py index d5ac8d261..8df184a1c 100644 --- a/src/hera/workflows/models/io/k8s/apimachinery/pkg/api/resource.py +++ b/src/hera/workflows/models/io/k8s/apimachinery/pkg/api/resource.py @@ -3,48 +3,53 @@ from __future__ import annotations +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field class Quantity(BaseModel): - __root__: str = Field( - ..., - description=( - "Quantity is a fixed-point representation of a number. It provides" - " convenient marshaling/unmarshaling in JSON and YAML, in addition to" - " String() and AsInt64() accessors.\n\nThe serialization format" - " is:\n\n ::= \n (Note that" - ' may be empty, from the "" case in .)\n ' - " ::= 0 | 1 | ... | 9 ::= | " - " ::= | . | . |" - ' . ::= "+" | "-" ::= ' - " | ::= | |" - " ::= Ki | Mi | Gi | Ti | Pi | Ei\n " - " (International System of units; See:" - " http://physics.nist.gov/cuu/Units/binary.html)\n ::= m |" - ' "" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I' - ' didn\'t choose the capitalization.)\n ::= "e"' - ' | "E" \n\nNo matter which of the three' - " exponent forms is used, no quantity may represent a number greater than" - " 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers" - " larger or more precise will be capped or rounded up. (E.g.: 0.1m will" - " rounded up to 1m.) This may be extended in the future if we require" - " larger or smaller quantities.\n\nWhen a Quantity is parsed from a string," - " it will remember the type of suffix it had, and will use the same type" - " again when it is serialized.\n\nBefore serializing, Quantity will be put" - ' in "canonical form". This means that Exponent/suffix will be adjusted up' - " or down (with a corresponding increase or decrease in Mantissa) such" - " that:\n a. No precision is lost\n b. No fractional digits will be" - " emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign" - " will be omitted unless the number is negative.\n\nExamples:\n 1.5 will" - ' be serialized as "1500m"\n 1.5Gi will be serialized as "1536Mi"\n\nNote' - " that the quantity will NEVER be internally represented by a floating" - " point number. That is the whole point of this exercise.\n\nNon-canonical" - " values will still parse as long as they are well formed, but will be" - " re-emitted in their canonical form. (So always use canonical form, or" - " don't diff.)\n\nThis format is intended to make it difficult to use" - " these numbers without writing some sort of special handling code in the" - " hopes that that will cause implementors to also use a fixed point" - " implementation." + __root__: Annotated[ + str, + Field( + description=( + "Quantity is a fixed-point representation of a number. It provides" + " convenient marshaling/unmarshaling in JSON and YAML, in addition to" + " String() and AsInt64() accessors.\n\nThe serialization format" + " is:\n\n ::= \n (Note that" + ' may be empty, from the "" case in .)\n ' + " ::= 0 | 1 | ... | 9 ::= |" + " ::= | . |" + ' . | . ::= "+" | "-" ' + " ::= | ::= |" + " | ::= Ki | Mi | Gi |" + " Ti | Pi | Ei\n (International System of units; See:" + " http://physics.nist.gov/cuu/Units/binary.html)\n ::=" + ' m | "" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 =' + ' 1k; I didn\'t choose the capitalization.)\n ::= "e"' + ' | "E" \n\nNo matter which of the three' + " exponent forms is used, no quantity may represent a number greater" + " than 2^63-1 in magnitude, nor may it have more than 3 decimal places." + " Numbers larger or more precise will be capped or rounded up. (E.g.:" + " 0.1m will rounded up to 1m.) This may be extended in the future if we" + " require larger or smaller quantities.\n\nWhen a Quantity is parsed" + " from a string, it will remember the type of suffix it had, and will" + " use the same type again when it is serialized.\n\nBefore serializing," + ' Quantity will be put in "canonical form". This means that' + " Exponent/suffix will be adjusted up or down (with a corresponding" + " increase or decrease in Mantissa) such that:\n a. No precision is" + " lost\n b. No fractional digits will be emitted\n c. The exponent" + " (or suffix) is as large as possible.\nThe sign will be omitted unless" + " the number is negative.\n\nExamples:\n 1.5 will be serialized as" + ' "1500m"\n 1.5Gi will be serialized as "1536Mi"\n\nNote that the' + " quantity will NEVER be internally represented by a floating point" + " number. That is the whole point of this exercise.\n\nNon-canonical" + " values will still parse as long as they are well formed, but will be" + " re-emitted in their canonical form. (So always use canonical form, or" + " don't diff.)\n\nThis format is intended to make it difficult to use" + " these numbers without writing some sort of special handling code in" + " the hopes that that will cause implementors to also use a fixed point" + " implementation." + ) ), - ) + ] diff --git a/src/hera/workflows/models/io/k8s/apimachinery/pkg/api/resource.pyi b/src/hera/workflows/models/io/k8s/apimachinery/pkg/api/resource.pyi deleted file mode 100644 index 62e5f6b47..000000000 --- a/src/hera/workflows/models/io/k8s/apimachinery/pkg/api/resource.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from hera.shared._pydantic import ( - BaseModel as BaseModel, - Field as Field, -) - -class Quantity(BaseModel): - __root__: str diff --git a/src/hera/workflows/models/io/k8s/apimachinery/pkg/apis/meta/v1.py b/src/hera/workflows/models/io/k8s/apimachinery/pkg/apis/meta/v1.py index c42be1cd0..5b4e3bc35 100644 --- a/src/hera/workflows/models/io/k8s/apimachinery/pkg/apis/meta/v1.py +++ b/src/hera/workflows/models/io/k8s/apimachinery/pkg/apis/meta/v1.py @@ -6,58 +6,86 @@ from datetime import datetime from typing import Dict, List, Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field -class CreateOptions(BaseModel): - dry_run: Optional[List[str]] = Field( - default=None, - alias="dryRun", - title=( - "When present, indicates that modifications should not be\npersisted. An" - " invalid or unrecognized dryRun directive will\nresult in an error" - " response and no further processing of the\nrequest. Valid values are:\n-" - " All: all dry run stages will be processed\n+optional" - ), - ) - field_manager: Optional[str] = Field( - default=None, - alias="fieldManager", - title=( - "fieldManager is a name associated with the actor or entity\nthat is making" - " these changes. The value must be less than or\n128 characters long, and" - " only contain printable characters,\nas defined by" - " https://golang.org/pkg/unicode/#IsPrint.\n+optional" - ), - ) - field_validation: Optional[str] = Field( - default=None, - alias="fieldValidation", - title=( - "fieldValidation instructs the server on how to handle\nobjects in the" - " request (POST/PUT/PATCH) containing unknown\nor duplicate fields," - " provided that the `ServerSideFieldValidation`\nfeature gate is also" - " enabled. Valid values are:\n- Ignore: This will ignore any unknown fields" - " that are silently\ndropped from the object, and will ignore all but the" - " last duplicate\nfield that the decoder encounters. This is the default" - " behavior\nprior to v1.23 and is the default behavior when" - " the\n`ServerSideFieldValidation` feature gate is disabled.\n- Warn: This" - " will send a warning via the standard warning response\nheader for each" - " unknown field that is dropped from the object, and\nfor each duplicate" - " field that is encountered. The request will\nstill succeed if there are" - " no other errors, and will only persist\nthe last of any duplicate fields." - " This is the default when the\n`ServerSideFieldValidation` feature gate is" - " enabled.\n- Strict: This will fail the request with a BadRequest error" - " if\nany unknown fields would be dropped from the object, or if" - " any\nduplicate fields are present. The error returned from the" - " server\nwill contain all unknown and duplicate fields" - " encountered.\n+optional" - ), - ) +class Time(BaseModel): + __root__: Annotated[ + datetime, + Field( + description=( + "Time is a wrapper around time.Time which supports correct marshaling" + " to YAML and JSON. Wrappers are provided for many of the factory" + " methods that the time package offers." + ) + ), + ] -class FieldsV1(BaseModel): - pass +class ListMeta(BaseModel): + continue_: Annotated[ + Optional[str], + Field( + alias="continue", + description=( + "continue may be set if the user set a limit on the number of items" + " returned, and indicates that the server has more data available. The" + " value is opaque and may be used to issue another request to the" + " endpoint that served this list to retrieve the next set of available" + " objects. Continuing a consistent list may not be possible if the" + " server configuration has changed or more than a few minutes have" + " passed. The resourceVersion field returned when using this continue" + " value will be identical to the value in the first response, unless" + " you have received this token from an error message." + ), + ), + ] = None + remaining_item_count: Annotated[ + Optional[int], + Field( + alias="remainingItemCount", + description=( + "remainingItemCount is the number of subsequent items in the list which" + " are not included in this list response. If the list request contained" + " label or field selectors, then the number of remaining items is" + " unknown and the field will be left unset and omitted during" + " serialization. If the list is complete (either because it is not" + " chunking or because this is the last chunk), then there are no more" + " remaining items and this field will be left unset and omitted during" + " serialization. Servers older than v1.15 do not set this field. The" + " intended use of the remainingItemCount is *estimating* the size of a" + " collection. Clients should not rely on the remainingItemCount to be" + " set or to be exact." + ), + ), + ] = None + resource_version: Annotated[ + Optional[str], + Field( + alias="resourceVersion", + description=( + "String that identifies the server's internal version of this object" + " that can be used by clients to determine when objects have changed." + " Value must be treated as opaque by clients and passed unmodified back" + " to the server. Populated by the system. Read-only. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" + ), + ), + ] = None + self_link: Annotated[ + Optional[str], + Field( + alias="selfLink", + description=( + "selfLink is a URL representing this object. Populated by the system." + " Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field" + " in 1.20 release and the field is planned to be removed in 1.21" + " release." + ), + ), + ] = None class GroupVersionResource(BaseModel): @@ -66,430 +94,496 @@ class GroupVersionResource(BaseModel): version: Optional[str] = None -class LabelSelectorRequirement(BaseModel): - key: str = Field(..., description="key is the label key that the selector applies to.") - operator: str = Field( - ..., - description=( - "operator represents a key's relationship to a set of values. Valid" - " operators are In, NotIn, Exists and DoesNotExist." - ), - ) - values: Optional[List[str]] = Field( - default=None, - description=( - "values is an array of string values. If the operator is In or NotIn, the" - " values array must be non-empty. If the operator is Exists or" - " DoesNotExist, the values array must be empty. This array is replaced" - " during a strategic merge patch." - ), - ) +class CreateOptions(BaseModel): + dry_run: Annotated[ + Optional[List[str]], + Field( + alias="dryRun", + title=( + "When present, indicates that modifications should not be\npersisted." + " An invalid or unrecognized dryRun directive will\nresult in an error" + " response and no further processing of the\nrequest. Valid values" + " are:\n- All: all dry run stages will be processed\n+optional" + ), + ), + ] = None + field_manager: Annotated[ + Optional[str], + Field( + alias="fieldManager", + title=( + "fieldManager is a name associated with the actor or entity\nthat is" + " making these changes. The value must be less than or\n128 characters" + " long, and only contain printable characters,\nas defined by" + " https://golang.org/pkg/unicode/#IsPrint.\n+optional" + ), + ), + ] = None + field_validation: Annotated[ + Optional[str], + Field( + alias="fieldValidation", + title=( + "fieldValidation instructs the server on how to handle\nobjects in the" + " request (POST/PUT/PATCH) containing unknown\nor duplicate fields," + " provided that the `ServerSideFieldValidation`\nfeature gate is also" + " enabled. Valid values are:\n- Ignore: This will ignore any unknown" + " fields that are silently\ndropped from the object, and will ignore" + " all but the last duplicate\nfield that the decoder encounters. This" + " is the default behavior\nprior to v1.23 and is the default behavior" + " when the\n`ServerSideFieldValidation` feature gate is disabled.\n-" + " Warn: This will send a warning via the standard warning" + " response\nheader for each unknown field that is dropped from the" + " object, and\nfor each duplicate field that is encountered. The" + " request will\nstill succeed if there are no other errors, and will" + " only persist\nthe last of any duplicate fields. This is the default" + " when the\n`ServerSideFieldValidation` feature gate is enabled.\n-" + " Strict: This will fail the request with a BadRequest error if\nany" + " unknown fields would be dropped from the object, or if any\nduplicate" + " fields are present. The error returned from the server\nwill contain" + " all unknown and duplicate fields encountered.\n+optional" + ), + ), + ] = None -class ListMeta(BaseModel): - continue_: Optional[str] = Field( - default=None, - alias="continue", - description=( - "continue may be set if the user set a limit on the number of items" - " returned, and indicates that the server has more data available. The" - " value is opaque and may be used to issue another request to the endpoint" - " that served this list to retrieve the next set of available objects." - " Continuing a consistent list may not be possible if the server" - " configuration has changed or more than a few minutes have passed. The" - " resourceVersion field returned when using this continue value will be" - " identical to the value in the first response, unless you have received" - " this token from an error message." - ), - ) - remaining_item_count: Optional[int] = Field( - default=None, - alias="remainingItemCount", - description=( - "remainingItemCount is the number of subsequent items in the list which are" - " not included in this list response. If the list request contained label" - " or field selectors, then the number of remaining items is unknown and the" - " field will be left unset and omitted during serialization. If the list is" - " complete (either because it is not chunking or because this is the last" - " chunk), then there are no more remaining items and this field will be" - " left unset and omitted during serialization. Servers older than v1.15 do" - " not set this field. The intended use of the remainingItemCount is" - " *estimating* the size of a collection. Clients should not rely on the" - " remainingItemCount to be set or to be exact." - ), - ) - resource_version: Optional[str] = Field( - default=None, - alias="resourceVersion", - description=( - "String that identifies the server's internal version of this object that" - " can be used by clients to determine when objects have changed. Value must" - " be treated as opaque by clients and passed unmodified back to the server." - " Populated by the system. Read-only. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" - ), - ) - self_link: Optional[str] = Field( - default=None, - alias="selfLink", - description=( - "selfLink is a URL representing this object. Populated by the system." - " Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in" - " 1.20 release and the field is planned to be removed in 1.21 release." - ), - ) +class OwnerReference(BaseModel): + api_version: Annotated[str, Field(alias="apiVersion", description="API version of the referent.")] + block_owner_deletion: Annotated[ + Optional[bool], + Field( + alias="blockOwnerDeletion", + description=( + 'If true, AND if the owner has the "foregroundDeletion" finalizer, then' + " the owner cannot be deleted from the key-value store until this" + " reference is removed. Defaults to false. To set this field, a user" + ' needs "delete" permission of the owner, otherwise 422 (Unprocessable' + " Entity) will be returned." + ), + ), + ] = None + controller: Annotated[ + Optional[bool], + Field(description="If true, this reference points to the managing controller."), + ] = None + kind: Annotated[ + str, + Field( + description=( + "Kind of the referent. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + ) + ), + ] + name: Annotated[ + str, + Field( + description=("Name of the referent. More info:" " http://kubernetes.io/docs/user-guide/identifiers#names") + ), + ] + uid: Annotated[ + str, + Field( + description=("UID of the referent. More info:" " http://kubernetes.io/docs/user-guide/identifiers#uids") + ), + ] class MicroTime(BaseModel): - __root__: datetime = Field( - ..., - description="MicroTime is version of Time with microsecond level precision.", - ) + __root__: Annotated[ + datetime, + Field(description="MicroTime is version of Time with microsecond level precision."), + ] -class OwnerReference(BaseModel): - api_version: str = Field(..., alias="apiVersion", description="API version of the referent.") - block_owner_deletion: Optional[bool] = Field( - default=None, - alias="blockOwnerDeletion", - description=( - 'If true, AND if the owner has the "foregroundDeletion" finalizer, then the' - " owner cannot be deleted from the key-value store until this reference is" - ' removed. Defaults to false. To set this field, a user needs "delete"' - " permission of the owner, otherwise 422 (Unprocessable Entity) will be" - " returned." - ), - ) - controller: Optional[bool] = Field( - default=None, - description="If true, this reference points to the managing controller.", - ) - kind: str = Field( - ..., - description=( - "Kind of the referent. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" - ), - ) - name: str = Field( - ..., - description=("Name of the referent. More info:" " http://kubernetes.io/docs/user-guide/identifiers#names"), - ) - uid: str = Field( - ..., - description=("UID of the referent. More info:" " http://kubernetes.io/docs/user-guide/identifiers#uids"), - ) +class FieldsV1(BaseModel): + pass -class StatusCause(BaseModel): - field: Optional[str] = Field( - default=None, - description=( - "The field of the resource that has caused this error, as named by its JSON" - " serialization. May include dot and postfix notation for nested" - " attributes. Arrays are zero-indexed. Fields may appear more than once in" - " an array of causes due to fields having multiple errors." - ' Optional.\n\nExamples:\n "name" - the field "name" on the current' - ' resource\n "items[0].name" - the field "name" on the first array entry' - ' in "items"' - ), - ) - message: Optional[str] = Field( - default=None, - description=( - "A human-readable description of the cause of the error. This field may be" - " presented as-is to a reader." - ), - ) - reason: Optional[str] = Field( - default=None, - description=( - "A machine-readable description of the cause of the error. If this value is" - " empty there is no information available." - ), - ) +class LabelSelectorRequirement(BaseModel): + key: Annotated[str, Field(description="key is the label key that the selector applies to.")] + operator: Annotated[ + str, + Field( + description=( + "operator represents a key's relationship to a set of values. Valid" + " operators are In, NotIn, Exists and DoesNotExist." + ) + ), + ] + values: Annotated[ + Optional[List[str]], + Field( + description=( + "values is an array of string values. If the operator is In or NotIn," + " the values array must be non-empty. If the operator is Exists or" + " DoesNotExist, the values array must be empty. This array is replaced" + " during a strategic merge patch." + ) + ), + ] = None -class Time(BaseModel): - __root__: datetime = Field( - ..., - description=( - "Time is a wrapper around time.Time which supports correct marshaling to" - " YAML and JSON. Wrappers are provided for many of the factory methods" - " that the time package offers." - ), - ) +class StatusCause(BaseModel): + field: Annotated[ + Optional[str], + Field( + description=( + "The field of the resource that has caused this error, as named by its" + " JSON serialization. May include dot and postfix notation for nested" + " attributes. Arrays are zero-indexed. Fields may appear more than" + " once in an array of causes due to fields having multiple errors." + ' Optional.\n\nExamples:\n "name" - the field "name" on the current' + ' resource\n "items[0].name" - the field "name" on the first array' + ' entry in "items"' + ) + ), + ] = None + message: Annotated[ + Optional[str], + Field( + description=( + "A human-readable description of the cause of the error. This field" + " may be presented as-is to a reader." + ) + ), + ] = None + reason: Annotated[ + Optional[str], + Field( + description=( + "A machine-readable description of the cause of the error. If this" + " value is empty there is no information available." + ) + ), + ] = None -class LabelSelector(BaseModel): - match_expressions: Optional[List[LabelSelectorRequirement]] = Field( - default=None, - alias="matchExpressions", - description=("matchExpressions is a list of label selector requirements. The" " requirements are ANDed."), - ) - match_labels: Optional[Dict[str, str]] = Field( - default=None, - alias="matchLabels", - description=( - "matchLabels is a map of {key,value} pairs. A single {key,value} in the" - " matchLabels map is equivalent to an element of matchExpressions, whose" - ' key field is "key", the operator is "In", and the values array contains' - ' only "value". The requirements are ANDed.' - ), - ) +class ManagedFieldsEntry(BaseModel): + api_version: Annotated[ + Optional[str], + Field( + alias="apiVersion", + description=( + "APIVersion defines the version of this resource that this field set" + ' applies to. The format is "group/version" just like the top-level' + " APIVersion field. It is necessary to track the version of a field set" + " because it cannot be automatically converted." + ), + ), + ] = None + fields_type: Annotated[ + Optional[str], + Field( + alias="fieldsType", + description=( + "FieldsType is the discriminator for the different fields format and" + ' version. There is currently only one possible value: "FieldsV1"' + ), + ), + ] = None + fields_v1: Annotated[ + Optional[FieldsV1], + Field( + alias="fieldsV1", + description=("FieldsV1 holds the first JSON version format as described in the" ' "FieldsV1" type.'), + ), + ] = None + manager: Annotated[ + Optional[str], + Field(description=("Manager is an identifier of the workflow managing these fields.")), + ] = None + operation: Annotated[ + Optional[str], + Field( + description=( + "Operation is the type of operation which lead to this" + " ManagedFieldsEntry being created. The only valid values for this" + " field are 'Apply' and 'Update'." + ) + ), + ] = None + subresource: Annotated[ + Optional[str], + Field( + description=( + "Subresource is the name of the subresource used to update that object," + " or empty string if the object was updated through the main resource." + " The value of this field is used to distinguish between managers, even" + " if they share the same name. For example, a status update will be" + " distinct from a regular update using the same manager name. Note that" + " the APIVersion field is not related to the Subresource field and it" + " always corresponds to the version of the main resource." + ) + ), + ] = None + time: Annotated[ + Optional[Time], + Field( + description=( + "Time is timestamp of when these fields were set. It should always be" " empty if Operation is 'Apply'" + ) + ), + ] = None -class ManagedFieldsEntry(BaseModel): - api_version: Optional[str] = Field( - default=None, - alias="apiVersion", - description=( - "APIVersion defines the version of this resource that this field set" - ' applies to. The format is "group/version" just like the top-level' - " APIVersion field. It is necessary to track the version of a field set" - " because it cannot be automatically converted." - ), - ) - fields_type: Optional[str] = Field( - default=None, - alias="fieldsType", - description=( - "FieldsType is the discriminator for the different fields format and" - ' version. There is currently only one possible value: "FieldsV1"' - ), - ) - fields_v1: Optional[FieldsV1] = Field( - default=None, - alias="fieldsV1", - description=("FieldsV1 holds the first JSON version format as described in the" ' "FieldsV1" type.'), - ) - manager: Optional[str] = Field( - default=None, - description="Manager is an identifier of the workflow managing these fields.", - ) - operation: Optional[str] = Field( - default=None, - description=( - "Operation is the type of operation which lead to this ManagedFieldsEntry" - " being created. The only valid values for this field are 'Apply' and" - " 'Update'." - ), - ) - subresource: Optional[str] = Field( - default=None, - description=( - "Subresource is the name of the subresource used to update that object, or" - " empty string if the object was updated through the main resource. The" - " value of this field is used to distinguish between managers, even if they" - " share the same name. For example, a status update will be distinct from a" - " regular update using the same manager name. Note that the APIVersion" - " field is not related to the Subresource field and it always corresponds" - " to the version of the main resource." - ), - ) - time: Optional[Time] = Field( - default=None, - description=( - "Time is timestamp of when these fields were set. It should always be empty" " if Operation is 'Apply'" - ), - ) +class LabelSelector(BaseModel): + match_expressions: Annotated[ + Optional[List[LabelSelectorRequirement]], + Field( + alias="matchExpressions", + description=("matchExpressions is a list of label selector requirements. The" " requirements are ANDed."), + ), + ] = None + match_labels: Annotated[ + Optional[Dict[str, str]], + Field( + alias="matchLabels", + description=( + "matchLabels is a map of {key,value} pairs. A single {key,value} in the" + " matchLabels map is equivalent to an element of matchExpressions," + ' whose key field is "key", the operator is "In", and the values array' + ' contains only "value". The requirements are ANDed.' + ), + ), + ] = None class ObjectMeta(BaseModel): - annotations: Optional[Dict[str, str]] = Field( - default=None, - description=( - "Annotations is an unstructured key value map stored with a resource that" - " may be set by external tools to store and retrieve arbitrary metadata." - " They are not queryable and should be preserved when modifying objects." - " More info: http://kubernetes.io/docs/user-guide/annotations" - ), - ) - cluster_name: Optional[str] = Field( - default=None, - alias="clusterName", - description=( - "The name of the cluster which the object belongs to. This is used to" - " distinguish resources with same name and namespace in different clusters." - " This field is not set anywhere right now and apiserver is going to ignore" - " it if set in create or update request." - ), - ) - creation_timestamp: Optional[Time] = Field( - default=None, - alias="creationTimestamp", - description=( - "CreationTimestamp is a timestamp representing the server time when this" - " object was created. It is not guaranteed to be set in happens-before" - " order across separate operations. Clients may not set this value. It is" - " represented in RFC3339 form and is in UTC.\n\nPopulated by the system." - " Read-only. Null for lists. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - ), - ) - deletion_grace_period_seconds: Optional[int] = Field( - default=None, - alias="deletionGracePeriodSeconds", - description=( - "Number of seconds allowed for this object to gracefully terminate before" - " it will be removed from the system. Only set when deletionTimestamp is" - " also set. May only be shortened. Read-only." - ), - ) - deletion_timestamp: Optional[Time] = Field( - default=None, - alias="deletionTimestamp", - description=( - "DeletionTimestamp is RFC 3339 date and time at which this resource will be" - " deleted. This field is set by the server when a graceful deletion is" - " requested by the user, and is not directly settable by a client. The" - " resource is expected to be deleted (no longer visible from resource" - " lists, and not reachable by name) after the time in this field, once the" - " finalizers list is empty. As long as the finalizers list contains items," - " deletion is blocked. Once the deletionTimestamp is set, this value may" - " not be unset or be set further into the future, although it may be" - " shortened or the resource may be deleted prior to this time. For example," - " a user may request that a pod is deleted in 30 seconds. The Kubelet will" - " react by sending a graceful termination signal to the containers in the" - " pod. After that 30 seconds, the Kubelet will send a hard termination" - " signal (SIGKILL) to the container and after cleanup, remove the pod from" - " the API. In the presence of network partitions, this object may still" - " exist after this timestamp, until an administrator or automated process" - " can determine the resource is fully terminated. If not set, graceful" - " deletion of the object has not been requested.\n\nPopulated by the system" - " when a graceful deletion is requested. Read-only. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - ), - ) - finalizers: Optional[List[str]] = Field( - default=None, - description=( - "Must be empty before the object is deleted from the registry. Each entry" - " is an identifier for the responsible component that will remove the entry" - " from the list. If the deletionTimestamp of the object is non-nil, entries" - " in this list can only be removed. Finalizers may be processed and removed" - " in any order. Order is NOT enforced because it introduces significant" - " risk of stuck finalizers. finalizers is a shared field, any actor with" - " permission can reorder it. If the finalizer list is processed in order," - " then this can lead to a situation in which the component responsible for" - " the first finalizer in the list is waiting for a signal (field value," - " external system, or other) produced by a component responsible for a" - " finalizer later in the list, resulting in a deadlock. Without enforced" - " ordering finalizers are free to order amongst themselves and are not" - " vulnerable to ordering changes in the list." - ), - ) - generate_name: Optional[str] = Field( - default=None, - alias="generateName", - description=( - "GenerateName is an optional prefix, used by the server, to generate a" - " unique name ONLY IF the Name field has not been provided. If this field" - " is used, the name returned to the client will be different than the name" - " passed. This value will also be combined with a unique suffix. The" - " provided value has the same validation rules as the Name field, and may" - " be truncated by the length of the suffix required to make the value" - " unique on the server.\n\nIf this field is specified and the generated" - " name exists, the server will NOT return a 409 - instead, it will either" - " return 201 Created or 500 with Reason ServerTimeout indicating a unique" - " name could not be found in the time allotted, and the client should retry" - " (optionally after the time indicated in the Retry-After" - " header).\n\nApplied only if Name is not specified. More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency" - ), - ) - generation: Optional[int] = Field( - default=None, - description=( - "A sequence number representing a specific generation of the desired state." - " Populated by the system. Read-only." - ), - ) - labels: Optional[Dict[str, str]] = Field( - default=None, - description=( - "Map of string keys and values that can be used to organize and categorize" - " (scope and select) objects. May match selectors of replication" - " controllers and services. More info:" - " http://kubernetes.io/docs/user-guide/labels" - ), - ) - managed_fields: Optional[List[ManagedFieldsEntry]] = Field( - default=None, - alias="managedFields", - description=( - "ManagedFields maps workflow-id and version to the set of fields that are" - " managed by that workflow. This is mostly for internal housekeeping, and" - " users typically shouldn't need to set or understand this field. A" - " workflow can be the user's name, a controller's name, or the name of a" - ' specific apply path like "ci-cd". The set of fields is always in the' - " version that the workflow used when modifying the object." - ), - ) - name: Optional[str] = Field( - default=None, - description=( - "Name must be unique within a namespace. Is required when creating" - " resources, although some resources may allow a client to request the" - " generation of an appropriate name automatically. Name is primarily" - " intended for creation idempotence and configuration definition. Cannot be" - " updated. More info:" - " http://kubernetes.io/docs/user-guide/identifiers#names" - ), - ) - namespace: Optional[str] = Field( - default=None, - description=( - "Namespace defines the space within which each name must be unique. An" - ' empty namespace is equivalent to the "default" namespace, but "default"' - " is the canonical representation. Not all objects are required to be" - " scoped to a namespace - the value of this field for those objects will be" - " empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info:" - " http://kubernetes.io/docs/user-guide/namespaces" - ), - ) - owner_references: Optional[List[OwnerReference]] = Field( - default=None, - alias="ownerReferences", - description=( - "List of objects depended by this object. If ALL objects in the list have" - " been deleted, this object will be garbage collected. If this object is" - " managed by a controller, then an entry in this list will point to this" - " controller, with the controller field set to true. There cannot be more" - " than one managing controller." - ), - ) - resource_version: Optional[str] = Field( - default=None, - alias="resourceVersion", - description=( - "An opaque value that represents the internal version of this object that" - " can be used by clients to determine when objects have changed. May be" - " used for optimistic concurrency, change detection, and the watch" - " operation on a resource or set of resources. Clients must treat these" - " values as opaque and passed unmodified back to the server. They may only" - " be valid for a particular resource or set of resources.\n\nPopulated by" - " the system. Read-only. Value must be treated as opaque by clients and ." - " More info:" - " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" - ), - ) - self_link: Optional[str] = Field( - default=None, - alias="selfLink", - description=( - "SelfLink is a URL representing this object. Populated by the system." - " Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in" - " 1.20 release and the field is planned to be removed in 1.21 release." - ), - ) - uid: Optional[str] = Field( - default=None, - description=( - "UID is the unique in time and space value for this object. It is typically" - " generated by the server on successful creation of a resource and is not" - " allowed to change on PUT operations.\n\nPopulated by the system." - " Read-only. More info:" - " http://kubernetes.io/docs/user-guide/identifiers#uids" - ), - ) + annotations: Annotated[ + Optional[Dict[str, str]], + Field( + description=( + "Annotations is an unstructured key value map stored with a resource" + " that may be set by external tools to store and retrieve arbitrary" + " metadata. They are not queryable and should be preserved when" + " modifying objects. More info:" + " http://kubernetes.io/docs/user-guide/annotations" + ) + ), + ] = None + cluster_name: Annotated[ + Optional[str], + Field( + alias="clusterName", + description=( + "The name of the cluster which the object belongs to. This is used to" + " distinguish resources with same name and namespace in different" + " clusters. This field is not set anywhere right now and apiserver is" + " going to ignore it if set in create or update request." + ), + ), + ] = None + creation_timestamp: Annotated[ + Optional[Time], + Field( + alias="creationTimestamp", + description=( + "CreationTimestamp is a timestamp representing the server time when" + " this object was created. It is not guaranteed to be set in" + " happens-before order across separate operations. Clients may not set" + " this value. It is represented in RFC3339 form and is in" + " UTC.\n\nPopulated by the system. Read-only. Null for lists. More" + " info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + ), + ), + ] = None + deletion_grace_period_seconds: Annotated[ + Optional[int], + Field( + alias="deletionGracePeriodSeconds", + description=( + "Number of seconds allowed for this object to gracefully terminate" + " before it will be removed from the system. Only set when" + " deletionTimestamp is also set. May only be shortened. Read-only." + ), + ), + ] = None + deletion_timestamp: Annotated[ + Optional[Time], + Field( + alias="deletionTimestamp", + description=( + "DeletionTimestamp is RFC 3339 date and time at which this resource" + " will be deleted. This field is set by the server when a graceful" + " deletion is requested by the user, and is not directly settable by a" + " client. The resource is expected to be deleted (no longer visible" + " from resource lists, and not reachable by name) after the time in" + " this field, once the finalizers list is empty. As long as the" + " finalizers list contains items, deletion is blocked. Once the" + " deletionTimestamp is set, this value may not be unset or be set" + " further into the future, although it may be shortened or the resource" + " may be deleted prior to this time. For example, a user may request" + " that a pod is deleted in 30 seconds. The Kubelet will react by" + " sending a graceful termination signal to the containers in the pod." + " After that 30 seconds, the Kubelet will send a hard termination" + " signal (SIGKILL) to the container and after cleanup, remove the pod" + " from the API. In the presence of network partitions, this object may" + " still exist after this timestamp, until an administrator or automated" + " process can determine the resource is fully terminated. If not set," + " graceful deletion of the object has not been requested.\n\nPopulated" + " by the system when a graceful deletion is requested. Read-only. More" + " info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" + ), + ), + ] = None + finalizers: Annotated[ + Optional[List[str]], + Field( + description=( + "Must be empty before the object is deleted from the registry. Each" + " entry is an identifier for the responsible component that will remove" + " the entry from the list. If the deletionTimestamp of the object is" + " non-nil, entries in this list can only be removed. Finalizers may be" + " processed and removed in any order. Order is NOT enforced because it" + " introduces significant risk of stuck finalizers. finalizers is a" + " shared field, any actor with permission can reorder it. If the" + " finalizer list is processed in order, then this can lead to a" + " situation in which the component responsible for the first finalizer" + " in the list is waiting for a signal (field value, external system, or" + " other) produced by a component responsible for a finalizer later in" + " the list, resulting in a deadlock. Without enforced ordering" + " finalizers are free to order amongst themselves and are not" + " vulnerable to ordering changes in the list." + ) + ), + ] = None + generate_name: Annotated[ + Optional[str], + Field( + alias="generateName", + description=( + "GenerateName is an optional prefix, used by the server, to generate a" + " unique name ONLY IF the Name field has not been provided. If this" + " field is used, the name returned to the client will be different than" + " the name passed. This value will also be combined with a unique" + " suffix. The provided value has the same validation rules as the Name" + " field, and may be truncated by the length of the suffix required to" + " make the value unique on the server.\n\nIf this field is specified" + " and the generated name exists, the server will NOT return a 409 -" + " instead, it will either return 201 Created or 500 with Reason" + " ServerTimeout indicating a unique name could not be found in the time" + " allotted, and the client should retry (optionally after the time" + " indicated in the Retry-After header).\n\nApplied only if Name is not" + " specified. More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency" + ), + ), + ] = None + generation: Annotated[ + Optional[int], + Field( + description=( + "A sequence number representing a specific generation of the desired" + " state. Populated by the system. Read-only." + ) + ), + ] = None + labels: Annotated[ + Optional[Dict[str, str]], + Field( + description=( + "Map of string keys and values that can be used to organize and" + " categorize (scope and select) objects. May match selectors of" + " replication controllers and services. More info:" + " http://kubernetes.io/docs/user-guide/labels" + ) + ), + ] = None + managed_fields: Annotated[ + Optional[List[ManagedFieldsEntry]], + Field( + alias="managedFields", + description=( + "ManagedFields maps workflow-id and version to the set of fields that" + " are managed by that workflow. This is mostly for internal" + " housekeeping, and users typically shouldn't need to set or" + " understand this field. A workflow can be the user's name, a" + " controller's name, or the name of a specific apply path like" + ' "ci-cd". The set of fields is always in the version that the workflow' + " used when modifying the object." + ), + ), + ] = None + name: Annotated[ + Optional[str], + Field( + description=( + "Name must be unique within a namespace. Is required when creating" + " resources, although some resources may allow a client to request the" + " generation of an appropriate name automatically. Name is primarily" + " intended for creation idempotence and configuration definition." + " Cannot be updated. More info:" + " http://kubernetes.io/docs/user-guide/identifiers#names" + ) + ), + ] = None + namespace: Annotated[ + Optional[str], + Field( + description=( + "Namespace defines the space within which each name must be unique. An" + ' empty namespace is equivalent to the "default" namespace, but' + ' "default" is the canonical representation. Not all objects are' + " required to be scoped to a namespace - the value of this field for" + " those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be" + " updated. More info: http://kubernetes.io/docs/user-guide/namespaces" + ) + ), + ] = None + owner_references: Annotated[ + Optional[List[OwnerReference]], + Field( + alias="ownerReferences", + description=( + "List of objects depended by this object. If ALL objects in the list" + " have been deleted, this object will be garbage collected. If this" + " object is managed by a controller, then an entry in this list will" + " point to this controller, with the controller field set to true." + " There cannot be more than one managing controller." + ), + ), + ] = None + resource_version: Annotated[ + Optional[str], + Field( + alias="resourceVersion", + description=( + "An opaque value that represents the internal version of this object" + " that can be used by clients to determine when objects have changed." + " May be used for optimistic concurrency, change detection, and the" + " watch operation on a resource or set of resources. Clients must treat" + " these values as opaque and passed unmodified back to the server. They" + " may only be valid for a particular resource or set of" + " resources.\n\nPopulated by the system. Read-only. Value must be" + " treated as opaque by clients and . More info:" + " https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency" + ), + ), + ] = None + self_link: Annotated[ + Optional[str], + Field( + alias="selfLink", + description=( + "SelfLink is a URL representing this object. Populated by the system." + " Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field" + " in 1.20 release and the field is planned to be removed in 1.21" + " release." + ), + ), + ] = None + uid: Annotated[ + Optional[str], + Field( + description=( + "UID is the unique in time and space value for this object. It is" + " typically generated by the server on successful creation of a" + " resource and is not allowed to change on PUT operations.\n\nPopulated" + " by the system. Read-only. More info:" + " http://kubernetes.io/docs/user-guide/identifiers#uids" + ) + ), + ] = None diff --git a/src/hera/workflows/models/io/k8s/apimachinery/pkg/apis/meta/v1.pyi b/src/hera/workflows/models/io/k8s/apimachinery/pkg/apis/meta/v1.pyi deleted file mode 100644 index 17085cef1..000000000 --- a/src/hera/workflows/models/io/k8s/apimachinery/pkg/apis/meta/v1.pyi +++ /dev/null @@ -1,80 +0,0 @@ -from datetime import datetime -from typing import Dict, List, Optional - -from hera.shared._pydantic import ( - BaseModel as BaseModel, - Field as Field, -) - -class CreateOptions(BaseModel): - dry_run: Optional[List[str]] - field_manager: Optional[str] - field_validation: Optional[str] - -class FieldsV1(BaseModel): ... - -class GroupVersionResource(BaseModel): - group: Optional[str] - resource: Optional[str] - version: Optional[str] - -class LabelSelectorRequirement(BaseModel): - key: str - operator: str - values: Optional[List[str]] - -class ListMeta(BaseModel): - continue_: Optional[str] - remaining_item_count: Optional[int] - resource_version: Optional[str] - self_link: Optional[str] - -class MicroTime(BaseModel): - __root__: datetime - -class OwnerReference(BaseModel): - api_version: str - block_owner_deletion: Optional[bool] - controller: Optional[bool] - kind: str - name: str - uid: str - -class StatusCause(BaseModel): - field: Optional[str] - message: Optional[str] - reason: Optional[str] - -class Time(BaseModel): - __root__: datetime - -class LabelSelector(BaseModel): - match_expressions: Optional[List[LabelSelectorRequirement]] - match_labels: Optional[Dict[str, str]] - -class ManagedFieldsEntry(BaseModel): - api_version: Optional[str] - fields_type: Optional[str] - fields_v1: Optional[FieldsV1] - manager: Optional[str] - operation: Optional[str] - subresource: Optional[str] - time: Optional[Time] - -class ObjectMeta(BaseModel): - annotations: Optional[Dict[str, str]] - cluster_name: Optional[str] - creation_timestamp: Optional[Time] - deletion_grace_period_seconds: Optional[int] - deletion_timestamp: Optional[Time] - finalizers: Optional[List[str]] - generate_name: Optional[str] - generation: Optional[int] - labels: Optional[Dict[str, str]] - managed_fields: Optional[List[ManagedFieldsEntry]] - name: Optional[str] - namespace: Optional[str] - owner_references: Optional[List[OwnerReference]] - resource_version: Optional[str] - self_link: Optional[str] - uid: Optional[str] diff --git a/src/hera/workflows/models/io/k8s/apimachinery/pkg/util/intstr.py b/src/hera/workflows/models/io/k8s/apimachinery/pkg/util/intstr.py index 592fcbd0c..156f2ff6c 100644 --- a/src/hera/workflows/models/io/k8s/apimachinery/pkg/util/intstr.py +++ b/src/hera/workflows/models/io/k8s/apimachinery/pkg/util/intstr.py @@ -3,8 +3,10 @@ from __future__ import annotations +from typing import Union + from hera.shared._pydantic import BaseModel class IntOrString(BaseModel): - __root__: str + __root__: Union[str, int] diff --git a/src/hera/workflows/models/io/k8s/apimachinery/pkg/util/intstr.pyi b/src/hera/workflows/models/io/k8s/apimachinery/pkg/util/intstr.pyi deleted file mode 100644 index 6f9697c73..000000000 --- a/src/hera/workflows/models/io/k8s/apimachinery/pkg/util/intstr.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from hera.shared._pydantic import BaseModel as BaseModel - -class IntOrString(BaseModel): - __root__: str diff --git a/src/hera/workflows/models/sensor.py b/src/hera/workflows/models/sensor.py index 174300031..c1868fbd8 100644 --- a/src/hera/workflows/models/sensor.py +++ b/src/hera/workflows/models/sensor.py @@ -5,6 +5,8 @@ from typing import Optional +from typing_extensions import Annotated + from hera.shared._pydantic import BaseModel, Field from .io.argoproj.events import v1alpha1 @@ -16,20 +18,24 @@ class DeleteSensorResponse(BaseModel): class LogEntry(BaseModel): - dependency_name: Optional[str] = Field( - default=None, alias="dependencyName", title="optional - trigger dependency name" - ) - event_context: Optional[str] = Field(default=None, alias="eventContext", title="optional - Cloud Event context") + dependency_name: Annotated[ + Optional[str], + Field(alias="dependencyName", title="optional - trigger dependency name"), + ] = None + event_context: Annotated[ + Optional[str], + Field(alias="eventContext", title="optional - Cloud Event context"), + ] = None level: Optional[str] = None msg: Optional[str] = None namespace: Optional[str] = None - sensor_name: Optional[str] = Field(default=None, alias="sensorName") + sensor_name: Annotated[Optional[str], Field(alias="sensorName")] = None time: Optional[v1.Time] = None - trigger_name: Optional[str] = Field(default=None, alias="triggerName", title="optional - any trigger name") + trigger_name: Annotated[Optional[str], Field(alias="triggerName", title="optional - any trigger name")] = None class CreateSensorRequest(BaseModel): - create_options: Optional[v1.CreateOptions] = Field(default=None, alias="createOptions") + create_options: Annotated[Optional[v1.CreateOptions], Field(alias="createOptions")] = None namespace: Optional[str] = None sensor: Optional[v1alpha1.Sensor] = None diff --git a/src/hera/workflows/models/sensor.pyi b/src/hera/workflows/models/sensor.pyi deleted file mode 100644 index 88ebbf238..000000000 --- a/src/hera/workflows/models/sensor.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from typing import Optional - -from hera.shared._pydantic import ( - BaseModel as BaseModel, - Field as Field, -) - -from .io.argoproj.events import v1alpha1 as v1alpha1 -from .io.k8s.apimachinery.pkg.apis.meta import v1 as v1 - -class DeleteSensorResponse(BaseModel): ... - -class LogEntry(BaseModel): - dependency_name: Optional[str] - event_context: Optional[str] - level: Optional[str] - msg: Optional[str] - namespace: Optional[str] - sensor_name: Optional[str] - time: Optional[v1.Time] - trigger_name: Optional[str] - -class CreateSensorRequest(BaseModel): - create_options: Optional[v1.CreateOptions] - namespace: Optional[str] - sensor: Optional[v1alpha1.Sensor] - -class SensorWatchEvent(BaseModel): - object: Optional[v1alpha1.Sensor] - type: Optional[str] - -class UpdateSensorRequest(BaseModel): - name: Optional[str] - namespace: Optional[str] - sensor: Optional[v1alpha1.Sensor] diff --git a/src/hera/workflows/parameter.py b/src/hera/workflows/parameter.py index f3a136a57..0ba959a63 100644 --- a/src/hera/workflows/parameter.py +++ b/src/hera/workflows/parameter.py @@ -79,6 +79,7 @@ def with_name(self, name: str) -> Parameter: def as_input(self) -> _ModelParameter: """Assembles the parameter for use as an input of a template.""" self._check_name() + assert self.name return _ModelParameter( name=self.name, description=self.description, @@ -95,6 +96,7 @@ def as_argument(self) -> _ModelParameter: # Overwrite ref: https://github.com/argoproj/argo-workflows/blob/781675ddcf6f1138d697cb9c71dae484daa0548b/workflow/common/util.go#L126-L139 # One of value/value_from required ref: https://github.com/argoproj/argo-workflows/blob/ab178bb0b36a5ce34b4c1302cf4855879a0e8cf5/workflow/validate/validate.go#L794-L798 self._check_name() + assert self.name return _ModelParameter( name=self.name, global_name=self.global_name, @@ -109,6 +111,7 @@ def as_output(self) -> _ModelParameter: # Only `value` and `value_from` are valid here # see https://github.com/argoproj/argo-workflows/blob/e3254eca115c9dd358e55d16c6a3d41403c29cae/workflow/validate/validate.go#L1067 self._check_name() + assert self.name return _ModelParameter( name=self.name, global_name=self.global_name, diff --git a/src/hera/workflows/retry_strategy.py b/src/hera/workflows/retry_strategy.py index a991eef23..345b1f578 100644 --- a/src/hera/workflows/retry_strategy.py +++ b/src/hera/workflows/retry_strategy.py @@ -49,7 +49,7 @@ class RetryStrategy(_BaseModel): expression: Optional[str] = None """the expression field supports the expression of complex rules regarding retry behavior""" - limit: Optional[Union[str, int, IntOrString]] = None + limit: Optional[Union[int, str, IntOrString]] = None """the hard numeric limit of how many times a jobs should retry""" retry_policy: Optional[Union[str, RetryPolicy]] = None @@ -65,12 +65,12 @@ def _convert_retry_policy(cls, v): return v.value @validator("limit", pre=True) - def _convert_limit(cls, v): + def _convert_limit(cls, v) -> Optional[IntOrString]: """Converts the `limit` field from the union specification into a `str`.""" if v is None or isinstance(v, IntOrString): return v - return str(v) # int or str + return IntOrString(__root__=v) def build(self) -> _ModelRetryStrategy: """Builds the generated `RetryStrategy` representation of the retry strategy.""" @@ -78,8 +78,8 @@ def build(self) -> _ModelRetryStrategy: affinity=self.affinity, backoff=self.backoff, expression=self.expression, - limit=self.limit, - retry_policy=self.retry_policy, + limit=self.limit, # type: ignore + retry_policy=str(self.retry_policy) if self.retry_policy is not None else None, ) diff --git a/src/hera/workflows/script.py b/src/hera/workflows/script.py index a01056441..2ff1d3534 100644 --- a/src/hera/workflows/script.py +++ b/src/hera/workflows/script.py @@ -201,7 +201,7 @@ def _build_script(self) -> _ModelScriptTemplate: if self.constructor.volume_for_outputs.mount_path is None: self.constructor.volume_for_outputs.mount_path = self.constructor.outputs_directory self._create_hera_outputs_volume(self.constructor.volume_for_outputs) - + assert self.image return self.constructor.transform_script_template_post_build( self, _ModelScriptTemplate( @@ -224,7 +224,9 @@ def _build_script(self) -> _ModelScriptTemplate: stdin=self.stdin, stdin_once=self.stdin_once, termination_message_path=self.termination_message_path, - termination_message_policy=self.termination_message_policy, + termination_message_policy=str(self.termination_message_policy) + if self.termination_message_policy + else None, tty=self.tty, volume_devices=self.volume_devices, volume_mounts=self._build_volume_mounts(), @@ -588,7 +590,7 @@ def script_wrapper( s = Script(name=name, source=source, **script_kwargs) @overload - def task_wrapper(*args: FuncIns.args, **kwargs: FuncIns.kwargs) -> FuncR: + def task_wrapper(*args: FuncIns.args, **kwargs: FuncIns.kwargs) -> FuncR: # type: ignore ... @overload diff --git a/src/hera/workflows/service.py b/src/hera/workflows/service.py index fa50fcb01..8b5b8b9b4 100644 --- a/src/hera/workflows/service.py +++ b/src/hera/workflows/service.py @@ -591,7 +591,7 @@ def get_info(self) -> InfoResponse: ) if resp.ok: - return InfoResponse() + return InfoResponse(**resp.json()) raise exception_from_server_response(resp) @@ -607,7 +607,7 @@ def get_user_info(self) -> GetUserInfoResponse: ) if resp.ok: - return GetUserInfoResponse() + return GetUserInfoResponse(**resp.json()) raise exception_from_server_response(resp) diff --git a/src/hera/workflows/steps.py b/src/hera/workflows/steps.py index f27db7783..567598d6a 100644 --- a/src/hera/workflows/steps.py +++ b/src/hera/workflows/steps.py @@ -18,6 +18,7 @@ ) from hera.workflows.exceptions import InvalidType from hera.workflows.models import ( + ParallelSteps, Template as _ModelTemplate, WorkflowStep as _ModelWorkflowStep, ) @@ -129,13 +130,13 @@ class Steps( ] ] = [] - def _build_steps(self) -> Optional[List[List[_ModelWorkflowStep]]]: + def _build_steps(self) -> Optional[List[ParallelSteps]]: steps = [] for workflow_step in self.sub_steps: if isinstance(workflow_step, Steppable): - steps.append(workflow_step._build_step()) + steps.append(ParallelSteps(__root__=workflow_step._build_step())) elif isinstance(workflow_step, _ModelWorkflowStep): - steps.append([workflow_step]) + steps.append(ParallelSteps(__root__=[workflow_step])) elif isinstance(workflow_step, List): substeps = [] for s in workflow_step: @@ -145,7 +146,7 @@ def _build_steps(self) -> Optional[List[List[_ModelWorkflowStep]]]: substeps.append(s) else: raise InvalidType(type(s)) - steps.append(substeps) + steps.append(ParallelSteps(__root__=substeps)) else: raise InvalidType(type(workflow_step)) diff --git a/src/hera/workflows/suspend.py b/src/hera/workflows/suspend.py index e0aad9fe7..e390a7877 100644 --- a/src/hera/workflows/suspend.py +++ b/src/hera/workflows/suspend.py @@ -35,14 +35,18 @@ class Suspend( def _build_suspend_template(self) -> _ModelSuspendTemplate: return _ModelSuspendTemplate( - duration=self.duration, + duration=str(self.duration) if self.duration else None, ) def _build_outputs(self) -> Optional[Outputs]: outputs = [] for param in self.intermediate_parameters: outputs.append( - Parameter(name=param.name, value_from={"supplied": {}}, description=param.description).as_output() + Parameter( + name=param.name, + value_from={"supplied": {}}, # type: ignore + description=param.description, + ).as_output() ) return Outputs(parameters=outputs) if outputs else None diff --git a/src/hera/workflows/user_container.py b/src/hera/workflows/user_container.py index 81a3d7ec8..258450c77 100644 --- a/src/hera/workflows/user_container.py +++ b/src/hera/workflows/user_container.py @@ -1,5 +1,5 @@ """The user container module provides user container functionality and objects.""" -from typing import List, Optional, Union +from typing import List, Optional, Union, cast from hera.workflows.env import _BaseEnv from hera.workflows.env_from import _BaseEnvFrom @@ -17,6 +17,7 @@ class UserContainer(_ModelUserContainer): """`UserContainer` is a container type that is specifically used as a side container.""" + # TODO: Use EnvMixin (currently a circular import) env: Optional[List[Union[_BaseEnv, EnvVar]]] = None # type: ignore[assignment] env_from: Optional[List[Union[_BaseEnvFrom, EnvFromSource]]] = None # type: ignore[assignment] image_pull_policy: Optional[Union[str, ImagePullPolicy]] = None # type: ignore[assignment] @@ -50,11 +51,17 @@ def _build_image_pull_policy(self) -> Optional[str]: def build(self) -> _ModelUserContainer: """Builds the Hera auto-generated model of the user container.""" + env: List[EnvVar] = [ + var if isinstance(var, EnvVar) else cast(_BaseEnv, var).build() for var in (self.env or []) + ] + env_from: List[EnvFromSource] = [ + var if isinstance(var, EnvFromSource) else cast(_BaseEnvFrom, var).build() for var in (self.env_from or []) + ] return _ModelUserContainer( args=self.args, command=self.command, - env=self.env, - env_from=self.env_from, + env=env or None, + env_from=env_from or None, image=self.image, image_pull_policy=self._build_image_pull_policy(), lifecycle=self.lifecycle, @@ -63,7 +70,11 @@ def build(self) -> _ModelUserContainer: name=self.name, ports=self.ports, readiness_probe=self.readiness_probe, - resources=self.resources, + resources=self.resources + if isinstance(self.resources, ResourceRequirements) + else self.resources.build() + if self.resources + else None, security_context=self.security_context, startup_probe=self.startup_probe, stdin=self.stdin, diff --git a/src/hera/workflows/volume.py b/src/hera/workflows/volume.py index e9321fa22..898df3af6 100644 --- a/src/hera/workflows/volume.py +++ b/src/hera/workflows/volume.py @@ -95,6 +95,8 @@ def _build_volume(self) -> _ModelVolume: raise NotImplementedError def _build_volume_mount(self) -> _ModelVolumeMount: + assert self.name + assert self.mount_path return _ModelVolumeMount( name=self.name, mount_path=self.mount_path, @@ -109,6 +111,7 @@ class AWSElasticBlockStoreVolumeVolume(_BaseVolume, _ModelAWSElasticBlockStoreVo """Representation of AWS elastic block store volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, aws_elastic_block_store=_ModelAWSElasticBlockStoreVolumeSource( @@ -121,6 +124,7 @@ class AzureDiskVolumeVolume(_BaseVolume, _ModelAzureDiskVolumeSource): """Representation of an Azure disk volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, azure_disk=_ModelAzureDiskVolumeSource( @@ -138,6 +142,7 @@ class AzureFileVolumeVolume(_BaseVolume, _ModelAzureFileVolumeSource): """Representation of an Azure file that can be mounted as a volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, azure_file=_ModelAzureFileVolumeSource( @@ -150,6 +155,7 @@ class CephFSVolumeVolume(_BaseVolume, _ModelCephFSVolumeSource): """Representation of a Ceph file system volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, cephfs=_ModelCephFSVolumeSource( @@ -167,6 +173,7 @@ class CinderVolume(_BaseVolume, _ModelCinderVolumeSource): """Representation of a Cinder volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, cinder=_ModelCinderVolumeSource( @@ -182,6 +189,7 @@ class ConfigMapVolume(_BaseVolume, _ModelConfigMapVolumeSource): # type: ignore """Representation of a config map volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, config_map=_ModelConfigMapVolumeSource( @@ -194,6 +202,7 @@ class CSIVolume(_BaseVolume, _ModelCSIVolumeSource): """Representation of a container service interface volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, csi=_ModelCSIVolumeSource( @@ -210,6 +219,7 @@ class DownwardAPIVolume(_BaseVolume, _ModelDownwardAPIVolumeSource): """Representation of a volume passed via the downward API.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, downward_api=_ModelDownwardAPIVolumeSource(default_mode=self.default_mode, items=self.items), @@ -220,6 +230,7 @@ class EmptyDirVolume(_BaseVolume, _ModelEmptyDirVolumeSource): """Representation of an empty dir volume from K8s.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, empty_dir=_ModelEmptyDirVolumeSource(medium=self.medium, size_limit=self.size_limit) ) @@ -229,6 +240,7 @@ class EphemeralVolume(_BaseVolume, _ModelEphemeralVolumeSource): """Representation of a volume that uses ephemeral storage shared with the K8s node a pod is scheduled on.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, ephemeral=_ModelEphemeralVolumeSource(volume_claim_template=self.volume_claim_template) ) @@ -238,6 +250,7 @@ class FCVolume(_BaseVolume, _ModelFCVolumeSource): """An FV volume representation.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, fc=_ModelFCVolumeSource( @@ -254,6 +267,7 @@ class FlexVolume(_BaseVolume, _ModelFlexVolumeSource): """A Flex volume representation.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, flex_volume=_ModelFlexVolumeSource( @@ -270,6 +284,7 @@ class FlockerVolume(_BaseVolume, _ModelFlockerVolumeSource): """A Flocker volume representation.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, flocker=_ModelFlockerVolumeSource(dataset_name=self.dataset_name, dataset_uuid=self.dataset_uuid), @@ -284,6 +299,7 @@ class GCEPersistentDiskVolume(_BaseVolume, _ModelGCEPersistentDiskVolumeSource): """ def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, gce_persistent_disk=_ModelGCEPersistentDiskVolumeSource( @@ -296,6 +312,7 @@ class GitRepoVolume(_BaseVolume, _ModelGitRepoVolumeSource): """A representation of a Git repo that can be mounted as a volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, git_repo=_ModelGitRepoVolumeSource( @@ -308,6 +325,7 @@ class GlusterfsVolume(_BaseVolume, _ModelGlusterfsVolumeSource): """A representation for a Gluster filesystem volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, glusterfs=_ModelGlusterfsVolumeSource(endpoints=self.endpoints, path=self.path, read_only=self.read_only), @@ -318,6 +336,7 @@ class HostPathVolume(_BaseVolume, _ModelHostPathVolumeSource): """Representation for a volume that can be mounted from a host path/node location.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume(name=self.name, host_path=_ModelHostPathVolumeSource(path=self.path, type=self.type)) @@ -325,6 +344,7 @@ class ISCSIVolume(_BaseVolume, _ModelISCSIVolumeSource): """Representation of ISCSI volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, iscsi=_ModelISCSIVolumeSource( @@ -347,6 +367,7 @@ class NFSVolume(_BaseVolume, _ModelNFSVolumeSource): """A network file system volume representation.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, nfs=_ModelNFSVolumeSource(server=self.server, path=self.path, read_only=self.read_only) ) @@ -356,6 +377,7 @@ class PhotonPersistentDiskVolume(_BaseVolume, _ModelPhotonPersistentDiskVolumeSo """A Photon Persisten Disk representation.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, photon_persistent_disk=_ModelPhotonPersistentDiskVolumeSource(fs_type=self.fs_type, pd_id=self.pd_id), @@ -366,6 +388,7 @@ class PortworxVolume(_BaseVolume, _ModelPortworxVolumeSource): """`PortworxVolume` represents a Portworx volume to mount to a container.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, portworx_volume=_ModelPortworxVolumeSource( @@ -378,6 +401,7 @@ class ProjectedVolume(_BaseVolume, _ModelProjectedVolumeSource): """`ProjectedVolume` represents a projected volume to mount to a container.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, projected=_ModelProjectedVolumeSource(default_mode=self.default_mode, sources=self.sources) ) @@ -387,6 +411,7 @@ class QuobyteVolume(_BaseVolume, _ModelQuobyteVolumeSource): """`QuobyteVolume` represents a Quobyte volume to mount to a container.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, quobyte=_ModelQuobyteVolumeSource( @@ -404,6 +429,7 @@ class RBDVolume(_BaseVolume, _ModelRBDVolumeSource): """An RDB volume representation.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, rbd=_ModelRBDVolumeSource( @@ -423,6 +449,7 @@ class ScaleIOVolume(_BaseVolume, _ModelScaleIOVolumeSource): """`ScaleIOVolume` represents a ScaleIO volume to mount to the container.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, scale_io=_ModelScaleIOVolumeSource( @@ -444,6 +471,7 @@ class SecretVolume(_BaseVolume, _ModelSecretVolumeSource): """`SecretVolume` supports mounting a K8s secret as a container volume.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, secret=_ModelSecretVolumeSource( @@ -456,6 +484,7 @@ class StorageOSVolume(_BaseVolume, _ModelStorageOSVolumeSource): """`StorageOSVolume` represents a Storage OS volume to mount.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, storageos=_ModelStorageOSVolumeSource( @@ -472,6 +501,7 @@ class VsphereVirtualDiskVolume(_BaseVolume, _ModelVsphereVirtualDiskVolumeSource """`VsphereVirtualDiskVolume` represents a vSphere virtual disk volume to mount.""" def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, vsphere_volume=_ModelVsphereVirtualDiskVolumeSource( @@ -491,6 +521,7 @@ class ExistingVolume(_BaseVolume, _ModelPersistentVolumeClaimVolumeSource): """ def _build_volume(self) -> _ModelVolume: + assert self.name return _ModelVolume( name=self.name, persistent_volume_claim=_ModelPersistentVolumeClaimVolumeSource( @@ -572,6 +603,7 @@ def _build_persistent_volume_claim(self) -> _ModelPersistentVolumeClaim: def _build_volume(self) -> _ModelVolume: claim = self._build_persistent_volume_claim() assert claim.metadata is not None, "claim metadata is required" + assert self.name return _ModelVolume( name=self.name, persistent_volume_claim=_ModelPersistentVolumeClaimVolumeSource( diff --git a/src/hera/workflows/workflow.py b/src/hera/workflows/workflow.py index 7752633fe..1fa1a395f 100644 --- a/src/hera/workflows/workflow.py +++ b/src/hera/workflows/workflow.py @@ -132,7 +132,7 @@ def _build_templates(self) -> Optional[List[TTemplate]]: raise InvalidType(f"{type(template)} is not a valid template type") if isinstance(template, VolumeClaimable): - claims = template._build_persistent_volume_claims() + claims = template._build_persistent_volume_claims() # type: ignore # If there are no claims, continue, nothing to add if not claims: continue @@ -380,7 +380,8 @@ def create(self, wait: bool = False, poll_interval: int = 5) -> TWorkflow: assert self.namespace, "workflow namespace not defined" wf = self.workflows_service.create_workflow( - WorkflowCreateRequest(workflow=self.build()), namespace=self.namespace + WorkflowCreateRequest(workflow=self.build()), # type: ignore + namespace=self.namespace, ) # set the workflow name to the name returned by the API, which helps cover the case of users relying on # `generate_name=True` @@ -430,7 +431,8 @@ def lint(self) -> TWorkflow: assert self.workflows_service, "workflow service not initialized" assert self.namespace, "workflow namespace not defined" return self.workflows_service.lint_workflow( - WorkflowLintRequest(workflow=self.build()), namespace=self.namespace + WorkflowLintRequest(workflow=self.build()), # type: ignore + namespace=self.namespace, ) def _add_sub(self, node: Any): diff --git a/src/hera/workflows/workflow_template.py b/src/hera/workflows/workflow_template.py index 384336028..472588187 100644 --- a/src/hera/workflows/workflow_template.py +++ b/src/hera/workflows/workflow_template.py @@ -55,7 +55,8 @@ def create(self) -> TWorkflow: # type: ignore assert self.workflows_service, "workflow service not initialized" assert self.namespace, "workflow namespace not defined" return self.workflows_service.create_workflow_template( - WorkflowTemplateCreateRequest(template=self.build()), namespace=self.namespace + WorkflowTemplateCreateRequest(template=self.build()), # type: ignore + namespace=self.namespace, ) def get(self) -> TWorkflow: @@ -86,7 +87,7 @@ def update(self) -> TWorkflow: return self.create() return self.workflows_service.update_workflow_template( self.name, - WorkflowTemplateUpdateRequest(template=template), + WorkflowTemplateUpdateRequest(template=template), # type: ignore namespace=self.namespace, ) @@ -95,7 +96,8 @@ def lint(self) -> TWorkflow: assert self.workflows_service, "workflow service not initialized" assert self.namespace, "workflow namespace not defined" return self.workflows_service.lint_workflow_template( - WorkflowTemplateLintRequest(template=self.build()), namespace=self.namespace + WorkflowTemplateLintRequest(template=self.build()), # type: ignore + namespace=self.namespace, ) def build(self) -> TWorkflow: diff --git a/tests/test_remaining_examples.py b/tests/test_remaining_examples.py index 35485e162..3a5af67cd 100644 --- a/tests/test_remaining_examples.py +++ b/tests/test_remaining_examples.py @@ -19,15 +19,9 @@ UPSTREAM_EXAMPLE_XFAIL_FILES = [ "cluster-workflow-template__clustertemplates.upstream.yaml", "cron-backfill.upstream.yaml", - "daemon-nginx.upstream.yaml", - "daemon-step.upstream.yaml", - "dag-daemon-task.upstream.yaml", - "default-pdb-support.upstream.yaml", - "influxdb-ci.upstream.yaml", "memoize-simple.upstream.yaml", "pod-gc-strategy-with-label-selector.upstream.yaml", "pod-gc-strategy.upstream.yaml", - "timeouts-step.upstream.yaml", "webhdfs-input-output-artifacts.upstream.yaml", "workflow-template__templates.upstream.yaml", ]